Convenience adapter for IComputeJob<T> implementations. It provides the following functionality:
More...
|
void | Cancel () |
| This method is called when system detects that completion of this job can no longer alter the overall outcome (for example, when parent task has already reduced the results). More...
|
|
void | SetArguments (params object[] args) |
| Sets given arguments. More...
|
|
TArg | GetArgument< TArg > (int idx) |
| Sets given arguments. More...
|
|
abstract T | Execute () |
| Executes this job. More...
|
|
TRes | Execute () |
| Executes this job. More...
|
|
void | Cancel () |
| This method is called when system detects that completion of this job can no longer alter the overall outcome (for example, when parent task has already reduced the results). More...
|
|
|
| ComputeJobAdapter () |
| No-arg constructor. More...
|
|
| ComputeJobAdapter (params object[] args) |
| Creates job with specified arguments. More...
|
|
bool | IsCancelled () |
| This method tests whether or not this job was cancelled. This method is thread-safe and can be called without extra synchronization. This method can be periodically called in IComputeJob<T>.Execute() method implementation to check whether or not this job cancelled. Note that system calls IComputeJob<T>.Cancel() method only as a hint and this is a responsibility of the implementation of the job to properly cancel its execution. More...
|
|
- Parameters
-
args | Optional job arguments. |
Note that job cancellation is only a hint, and it is really up to the actual job instance to gracefully finish execution and exit.
- Returns
- Job execution result (possibly
null
). This result will be returned in IComputeJobResult<T> object passed into IComputeTask<TA,T,TR>.OnResult on caller node.
- Parameters
-
idx | Index of the argument. |
- Returns
True
if this job was cancelled, false
otherwise.
- Parameters
-
args | Optional job arguments to set. |