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)
callback
The task to invoke upon execution.
mixed[]
The arguments to provide to the task.
execute() : \void.
\void.
getArguments() : mixed[]
getError() : string
string
getResult() : null | mixed
null
mixed
getReturnCode() : int
This method may return -1 if no return code is available yet.
int
getTask() : callback
setError(string $error) : void
string
The error message.
setResult(mixed $result) : void
mixed
The 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.
int
Recommended to be a positive number
\InvalidArgumentException |
if the code is not a number or negative |
---|
setTask(callback $task) : void
see | \global\DocBlox_Parallel_Worker::__construct() |
---|---|
see | \global\DocBlox_Parallel_Worker::execute() |
callback
The 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