Class that represents the execution of a single task within a parallelized frame.
category |
DocBlox |
---|---|
package |
Parallel |
author |
Mike van Riel mike.vanriel@naenius.com |
license | |
link |
__construct(callback $task, array<mixed,mixed> $arguments = array())
callback
The task to invoke upon execution.
array<mixed,mixed>
The arguments to provide to the task.
execute() : \void.
\void.
getArguments() : array<mixed,mixed>
getError() : string
string
getResult() : null|mixed
null|mixed
getReturnCode() : integer
This method may return -1 if no return code is available yet.
integer
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(integer $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.
throw |
if the code is not a number or negative |
---|
integer
Recommended to be a positive number
setTask(callback $task) : void
throws |
if the given argument is not a callback. |
---|---|
see | \DocBlox_Parallel_Worker::__construct() \DocBlox_Parallel_Worker::execute() |
callback
The task to execute when the execute method is invoked.
task : callback
var |
the task to execute for this worker |
---|
callback
arguments : array<mixed,mixed>
var |
A list of argument to pass to the task |
---|
array<mixed,mixed>
return_code : integer
var |
The return code to tell the parent process how it went |
---|
integer
result : mixed
var |
The result of the given task |
---|
mixed
error : string
var |
The error message, if an error occurred |
---|
string