PHP » GoLang |
login |
register |
about
|
GoLang GearmanClient::addTask
request it (411)
GoLang replacement for PHP's GearmanClient::addTask
[edit | history]
GearmanClient::addTask(PECL gearman >= 0.5.0) GearmanClient::addTask — Add a task to be run in parallel Description
public GearmanTask GearmanClient::addTask
( string
$function_name
, string $workload
[, mixed &$context
[, string $unique
]] )Adds a task to be run in parallel with other tasks. Call this method for all the tasks to be run in parallel, then call GearmanClient::runTasks() to perform the work. Note that enough workers need to be available for the tasks to all run in parallel. Parameters
Return Values
A GearmanTask object or Examples
Example #1 Basic submission of two tasks
<?php The above example will output something similar to: COMPLETE: 2, Hello World! COMPLETE: 1, !dlroW olleH Example #2 Basic submission of two tasks with passing application context
<?php The above example will output something similar to: t2: H.foo:21, Hello World! t1: H:foo:22, !dlroW olleH See Also
|
more
Recently updated
more
Most requested
more
Last requests
|