« PHP 8.3 Manual トップ
著作権 »
per page, with , order by , clip by
Results of 1 - 10 of about 11 for gmclient (0.001 sec.)
GearmanClient::do — Run a single task and return a result [deprecated] | PHP 8.... 11273
GearmanClient::do (PECL gearman >= 0.5.0) GearmanClient::do — Run a single task and return a result [deprecated] 説明 public function GearmanClient::do ( string $function_name , string $workload , string $unique = ? ): string The GearmanCli ... k. 例 例1 Simple job submission with immediate return <?php # Client code echo "Starting\n" ; # Create our client object. $gmclient = new GearmanClient (); # Add default server (localhost). $gmclient -> addServer (); echo "Sending job\n" ; $result = $gmc ... ll to GearmanClient::do() produces status information on the running job. <?php # Client code # Create our client object. $gmclient = new GearmanClient (); # Add default server (localhost). $gmclient -> addServer (); echo "Sending job\n" ; # Send reverse ... job do { $result = $gmclient -> doNormal ( "reverse" , "Hello!" ); # Check for various return packets and errors. switch( $gmclient -> returnCode ()) { ...
https://man.mtool.work/php/8.3/gearmanclient.do.html
GearmanClient::doNormal — Run a single task and return a result | PHP 8.3 11273
GearmanClient::doNormal (No version information available, might only be in Git) GearmanClient::doNormal — Run a single task and return a result 説明 public function GearmanClient::doNormal ( string $function , string $workload , ? string $ ... Simple job submission with immediate return <?php ?> <?php # Client code echo "Starting\n" ; # Create our client object. $gmclient = new GearmanClient (); # Add default server (localhost). $gmclient -> addServer (); echo "Sending job\n" ; $result = $gmc ... GearmanClient::doNormal() produces status information on the running job. <?php # Client code # Create our client object. $gmclient = new GearmanClient (); # Add default server (localhost). $gmclient -> addServer (); echo "Sending job\n" ; # Send reverse ... job do { $result = $gmclient -> doNormal ( "reverse" , "Hello!" ); # Check for various return packets and errors. switch( $gmclient -> returnCode ()) { ...
https://man.mtool.work/php/8.3/gearmanclient.donormal.html
GearmanClient::addTaskStatus — Add a task to get status | PHP 8.3 11006
GearmanClient::addTaskStatus (PECL gearman >= 0.5.0) GearmanClient::addTaskStatus — Add a task to get status 説明 public function GearmanClient::addTaskStatus ( string $job_handle , mixed $context = null ): GearmanTask | false Used to reque ... mple to simulate a long running process. There is only one worker running for this example. <?php /* create our object */ $gmclient = new GearmanClient (); /* add the default server */ $gmclient -> addServer (); /* start some background jobs and save the ... handles */ $handles = array(); $handles [ 0 ] = $gmclient -> doBackground ( "reverse" , "Hello World!" ); $handles [ 1 ] = $gmclient -> doBackground ( "reverse" , "!dlroW olleH" ); ... $gmclient -> setStatusCallback ( "reverse_status" ); /* Poll the server to see when those background jobs finish; */ /* a better met ...
https://man.mtool.work/php/8.3/gearmanclient.addtaskstatus.html
GearmanClient::doStatus — Get the status for the running task | PHP 8.3 10349
GearmanClient::doStatus (PECL gearman >= 0.5.0) GearmanClient::doStatus — Get the status for the running task 説明 public function GearmanClient::doStatus (): array Returns the status for the running task. This should be used between repeat ... delay it calls GearmanJob::status() which the client then picks up. <?php echo "Starting\n" ; # Create our client object. $gmclient = new GearmanClient (); # Add default server (localhost). $gmclient -> addServer (); echo "Sending job\n" ; # Send reverse ... job do { $result = $gmclient -> doNormal ( "reverse" , "Hello!" ); # Check for various return packets and errors. switch( $gmclient -> returnCode ()) { ... ase GEARMAN_WORK_DATA : break; case GEARMAN_WORK_STATUS : # get the current job status list( $numerator , $denominator )= $gmclient -> doStatus (); echo "Status: $numerator / $denominator complete\n" ; break; case GEARMAN_WORK_FAIL : echo "Failed\n" ; ex ...
https://man.mtool.work/php/8.3/gearmanclient.dostatus.html
Basic usage | PHP 8.3 9157
Basic usage 例1 Basic Gearman client and worker This example shows a very simple client and worker. The client sends a string to the job server, and the worker reverses the string and sends it back. The job is performed synchronously. <?php ... # Create our client object. $gmclient = new GearmanClient (); # Add default server (localhost). $gmclient -> addServer (); echo "Sending job\n" ; # Send reverse ... job do { $result = $gmclient -> doNormal ( "reverse" , "Hello!" ); # Check for various return packets and errors. switch( $gmclient -> returnCode ()) { ... case GEARMAN_WORK_DATA : echo "Data: $result \n" ; break; case GEARMAN_WORK_STATUS : list( $numerator , $denominator )= $gmclient -> doStatus (); echo "Status: $numerator / $denominator complete\n" ; break; case GEARMAN_WORK_FAIL : echo "Failed\n" ; ex ...
https://man.mtool.work/php/8.3/gearman.examples-reverse.html
GearmanClient::addTask — Add a task to be run in parallel | PHP 8.3 8232
GearmanClient::addTask (PECL gearman >= 0.5.0) GearmanClient::addTask — Add a task to be run in parallel 説明 public function GearmanClient::addTask ( string $function_name , string | int | float $workload , mixed $context = null , ? string ... sk object or false if the task could not be added. 例 例1 Basic submission of two tasks <?php # Create our gearman client $gmclient = new GearmanClient (); # add the default job server $gmclient -> addServer (); # set a function to be called when the wor ... k is complete $gmclient -> setCompleteCallback ( "complete" ); # add a task to perform the "reverse" function on the string "Hello World!" $gmclie ... verse" , "Hello World!" , null , "1" ); # add another task to perform the "reverse" function on the string "!dlroW olleH" $gmclient -> addTask ( "reverse" , "!dlroW olleH" , null , "2" ); # run the tasks $gmclient -> runTasks (); function complete ( $tas ...
https://man.mtool.work/php/8.3/gearmanclient.addtask.html
GearmanClient::jobStatus — Get the status of a background job | PHP 8.3 8232
GearmanClient::jobStatus gearman_job_status (PECL gearman >= 0.5.0) GearmanClient::jobStatus -- gearman_job_status — Get the status of a background job 説明 オブジェクト指向型 (method): public function GearmanClient::jobStatus ( string $job ... letion percentage, respectively. 例 例1 Monitor the status of a long running background job <?php /* create our object */ $gmclient = new GearmanClient (); /* add the default server */ $gmclient -> addServer (); /* run reverse client */ $job_handle = $gm ... client -> doBackground ( "reverse" , "this is a test" ); if ( $gmclient -> returnCode () != GEARMAN_SUCCESS ) { echo "bad return code\n" ; exit; } $done = false ; do { sleep ( 3 ); $stat = $gmcl ...
https://man.mtool.work/php/8.3/gearmanclient.jobstatus.html
GearmanClient::doBackground — Run a task in the background | PHP 8.3 8126
GearmanClient::doBackground (PECL gearman >= 0.5.0) GearmanClient::doBackground — Run a task in the background 説明 public function GearmanClient::doBackground ( string $function , string $workload , ? string $unique = null ): string Runs a ... ic a long running job. The client script periodically checks the status of the running job. <?php /* create our object */ $gmclient = new GearmanClient (); /* add the default server */ $gmclient -> addServer (); /* run reverse client */ $job_handle = $gm ... client -> doBackground ( "reverse" , "this is a test" ); if ( $gmclient -> returnCode () != GEARMAN_SUCCESS ) { echo "bad return code\n" ; exit; } $done = false ; do { sleep ( 3 ); $stat = $gmcl ...
https://man.mtool.work/php/8.3/gearmanclient.dobackground.html
GearmanClient::addServer — Add a job server to the client | PHP 8.3 7112
GearmanClient::addServer (PECL gearman >= 0.5.0) GearmanClient::addServer — Add a job server to the client 説明 public function GearmanClient::addServer ( string $host = null , int $port = 0 , bool $setupExceptionHandler = true ): bool Adds ... 成功した場合に true を、失敗した場合に false を返します。 例 例1 Adding two job servers <?php # Create our client object. $gmclient = new GearmanClient (); # Add two job servers, the first on the default 4730 port $gmclient -> addServer ( "10.0.0.1" ); $ ...
https://man.mtool.work/php/8.3/gearmanclient.addserver.html
Basic Gearman client and worker, background | PHP 8.3 6934
Basic Gearman client and worker, background 例1 Basic Gearman client and worker, background This example shows a very simple client and worker. The client sends a string to the job server as a background job, and the worker reverses the str ... ait for the job to complete and exits (and hence the client never receives the results). <?php # create our client object $gmclient = new GearmanClient (); # add the default server (localhost) $gmclient -> addServer (); # run reverse client in the backgr ... ound $job_handle = $gmclient -> doBackground ( "reverse" , "this is a test" ); if ( $gmclient -> returnCode () != GEARMAN_SUCCESS ) { echo "bad return ...
https://man.mtool.work/php/8.3/gearman.examples-reverse-bg.html
PREV 1 2 NEXT