PHP » GoLang |
login |
register |
about
|
GoLang GearmanClient::do
request it (471)
GoLang replacement for PHP's GearmanClient::do
[edit | history]
GearmanClient::do(PECL gearman >= 0.5.0) GearmanClient::do — Run a single task and return a result [deprecated] Description
public string GearmanClient::do
( string
$function_name
, string $workload
[, string $unique
] )The GearmanClient::do() method is deprecated as of pecl/gearman 1.0.0. Use GearmanClient::doNormal(). Parameters
Return ValuesA string representing the results of running a task. Examples
Example #1 Simple job submission with immediate return
<?php
<?php The above example will output something similar to: Starting Sending job Success: !olleH Example #2 Submitting a job and retrieving incremental status A job is submitted and the script loops to retrieve status information. The worker has an artificial delay which results in a long running job and sends status and data as processing occurs. Each subsequent call to GearmanClient::do() produces status information on the running job.
<?php
<?php The above example will output something similar to: Worker output: Starting Waiting for job... Received job: H:foo.local:106 Workload: Hello! (6) 1/6 complete 2/6 complete 3/6 complete 4/6 complete 5/6 complete 6/6 complete Result: !olleH Client output: Starting Sending job Status: 1/6 complete Data: H Status: 2/6 complete Data: e Status: 3/6 complete Data: l Status: 4/6 complete Data: l Status: 5/6 complete Data: o Status: 6/6 complete Data: ! Success: !olleH See Also
|
more
Recently updated
more
Most requested
more
Last requests
|