Class that represents the execution of a single task within a parallelized frame.
| category | DocBlox |
|---|---|
| package | Parallel |
| author | Mike van Riel |
| license | MIT |
| link | http://docblox-project.org |
__construct(callback $task, array $arguments)
callbackThe task to invoke upon execution.
mixed[]The arguments to provide to the task.
execute() : \void.
\void.getArguments() : mixed[]
getError() : string
stringgetResult() : null | mixed
nullmixed
getReturnCode() : int
This method may return -1 if no return code is available yet.
intgetTask() : callback
setError(string $error) : void
stringThe error message.
setResult(mixed $result) : void
mixedThe value that is returned by the task; can be anything.
setReturnCode(int $return_code) : void
Recommended is to use the same codes as are used with exit codes.
In short: 0 means that the task succeeded and a any other positive value indicates an error condition.
intRecommended to be a positive number
setTask(callback $task) : void
| see | \DocBlox_Parallel_Worker::__construct() |
|---|---|
| see | \DocBlox_Parallel_Worker::execute() |
callbackThe task to execute when the execute method is invoked.
\InvalidArgumentException |
if the given argument is not a callback. |
|---|
$arguments : mixed[]
$error : string
$result : mixed
$return_code : int
$task : callback