« PHP 8.3 Manual トップ
著作権 »
per page, with , order by , clip by
Results of 1 - 7 of about 7 for gmworker (0.001 sec.)
GearmanWorker::setTimeout — Set socket I/O activity timeout | PHP 8.3 12141
GearmanWorker::setTimeout (PECL gearman >= 0.6.0) GearmanWorker::setTimeout — Set socket I/O activity timeout 説明 public function GearmanWorker::setTimeout ( int $timeout ): true Sets the interval of time to wait for socket I/O activity. パ ... 常に true を返します。 例 例1 A simple worker with a 5 second timeout <?php echo "Starting\n" ; # Create our worker object. $gmworker = new GearmanWorker (); # Add default server (localhost). $gmworker -> addServer (); # Register function "reverse" with th ... e server. $gmworker -> addFunction ( "reverse" , "reverse_fn" ); # Set the timeout to 5 seconds $gmworker -> setTimeout ( 5000 ); echo "Waitin ... g for job...\n" ; while(@ $gmworker -> work () || $gmworker -> returnCode () == GEARMAN_TIMEOUT ) { if ( $gmworker -> returnCode () == GEARMAN_TIMEOUT ) { # N ...
https://man.mtool.work/php/8.3/gearmanworker.settimeout.html
GearmanClient::do — Run a single task and return a result [deprecated] | PHP 8.... 10505
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 ... doNormal ( "reverse" , "Hello!" ); echo "Success: $result \n" ; ?> <?php echo "Starting\n" ; # Create our worker object. $gmworker = new GearmanWorker (); # Add default server (localhost). $gmworker -> addServer (); # Register function "reverse" with th ... e server. Change the worker function to # "reverse_fn_fast" for a faster worker with no output. $gmworker -> addFunction ( "reverse" , "reverse_fn" ); print "Waiting for job...\n" ; while( $gmworker -> work ()) { if ( $gmworker ... -> returnCode () != GEARMAN_SUCCESS ) { echo "return_code: " . $gmworker -> returnCode () . "\n" ; break; } } function reverse_fn ( $job ) { return strrev ( $job -> workload ()); } ?> 上の例の出力 ...
https://man.mtool.work/php/8.3/gearmanclient.do.html
GearmanClient::doNormal — Run a single task and return a result | PHP 8.3 10505
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 $ ... doNormal ( "reverse" , "Hello!" ); echo "Success: $result \n" ; ?> <?php echo "Starting\n" ; # Create our worker object. $gmworker = new GearmanWorker (); # Add default server (localhost). $gmworker -> addServer (); # Register function "reverse" with th ... e server. Change the worker function to # "reverse_fn_fast" for a faster worker with no output. $gmworker -> addFunction ( "reverse" , "reverse_fn" ); print "Waiting for job...\n" ; while( $gmworker -> work ()) { if ( $gmworker ... -> returnCode () != GEARMAN_SUCCESS ) { echo "return_code: " . $gmworker -> returnCode () . "\n" ; break; } } function reverse_fn ( $job ) { return strrev ( $job -> workload ()); } ?> 上の例の出力 ...
https://man.mtool.work/php/8.3/gearmanclient.donormal.html
Basic Gearman client and worker, background | PHP 8.3 8142
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 ... _SUCCESS ) { echo "bad return code\n" ; exit; } echo "done!\n" ; ?> <?php echo "Starting\n" ; # Create our worker object. $gmworker = new GearmanWorker (); # Add default server (localhost). $gmworker -> addServer (); # Register function "reverse" with th ... e server. Change the worker function to # "reverse_fn_fast" for a faster worker with no output. $gmworker -> addFunction ( "reverse" , "reverse_fn" ); print "Waiting for job...\n" ; while( $gmworker -> work ()) { if ( $gmworker ... -> returnCode () != GEARMAN_SUCCESS ) { echo "return_code: " . $gmworker -> returnCode () . "\n" ; break; } } function reverse_fn ( $job ) { echo "Received job: " . $job -> handle () . "\n" ; $wo ...
https://man.mtool.work/php/8.3/gearman.examples-reverse-bg.html
Basic usage | PHP 8.3 7906
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 ... xit; } } while( $gmclient -> returnCode () != GEARMAN_SUCCESS ); ?> <?php echo "Starting\n" ; # Create our worker object. $gmworker = new GearmanWorker (); # Add default server (localhost). $gmworker -> addServer (); # Register function "reverse" with th ... e server. Change the worker function to # "reverse_fn_fast" for a faster worker with no output. $gmworker -> addFunction ( "reverse" , "reverse_fn" ); print "Waiting for job...\n" ; while( $gmworker -> work ()) { if ( $gmworker ... -> returnCode () != GEARMAN_SUCCESS ) { echo "return_code: " . $gmworker -> returnCode () . "\n" ; break; } } function reverse_fn ( $job ) { echo "Received job: " . $job -> handle () . "\n" ; $wo ...
https://man.mtool.work/php/8.3/gearman.examples-reverse.html
Basic Gearman client and worker, submitting tasks | PHP 8.3 7415
Basic Gearman client and worker, submitting tasks 例1 Basic Gearman client and worker, submitting tasks In this example, the basic reverse client extended to run two tasks in parallel. The reverse worker is unchanged except to add sending o ... rse_data ( $task ) { echo "DATA: " . $task -> data () . "\n" ; } ?> <?php echo "Starting\n" ; # Create our worker object. $gmworker = new GearmanWorker (); # Add default server (localhost). $gmworker -> addServer (); # Register function "reverse" with th ... e server. Change the worker function to # "reverse_fn_fast" for a faster worker with no output. $gmworker -> addFunction ( "reverse" , "reverse_fn" ); print "Waiting for job...\n" ; while( $gmworker -> work ()) { if ( $gmworker ... -> returnCode () != GEARMAN_SUCCESS ) { echo "return_code: " . $gmworker -> returnCode () . "\n" ; break; } } function reverse_fn ( $job ) { echo "Received job: " . $job -> handle () . "\n" ; $wo ...
https://man.mtool.work/php/8.3/gearman.examples-reverse-task.html
GearmanClient::addTaskBackground — Add a background task to be run in parallel ... 6925
GearmanClient::addTaskBackground (PECL gearman >= 0.5.0) GearmanClient::addTaskBackground — Add a background task to be run in parallel 説明 public function GearmanClient::addTaskBackground ( string $function_name , string | int | float $wo ... ique () . ", " . $task -> data () . "\n" ; } ?> <?php # The worker script echo "Starting\n" ; # Create our worker object. $gmworker = new GearmanWorker (); # Add default server (localhost). $gmworker -> addServer (); # Register function "reverse" with th ... e server. $gmworker -> addFunction ( "reverse" , "reverse_fn" ); print "Waiting for job...\n" ; while( $gmworker -> work ()) { if ( $gmworker ... -> returnCode () != GEARMAN_SUCCESS ) { echo "return_code: " . $gmworker -> returnCode () . "\n" ; break; } } function reverse_fn ( $job ) { echo "Received job: " . $job -> handle () . "\n" ; $wo ...
https://man.mtool.work/php/8.3/gearmanclient.addtaskbackground.html
PREV 1 NEXT