Worker
in
An interface for a parallel worker thread that runs a queue of tasks.
Table of Contents
Methods
- isIdle() : bool
- Checks if the worker is currently idle.
- isRunning() : bool
- Checks if the worker is running.
- kill() : void
- Immediately kills the context.
- shutdown() : void
- Gracefully shutdown the worker once all outstanding tasks have completed executing. Returns once the worker has been shutdown.
- submit() : Execution<TReceive, TSend>
Methods
isIdle()
Checks if the worker is currently idle.
public
isIdle() : bool
Return values
boolisRunning()
Checks if the worker is running.
public
isRunning() : bool
Return values
bool —True if the worker is running, otherwise false.
kill()
Immediately kills the context.
public
kill() : void
shutdown()
Gracefully shutdown the worker once all outstanding tasks have completed executing. Returns once the worker has been shutdown.
public
shutdown() : void
submit()
public
submit(Task<TReceive, TSend> $task[, Cancellation|null $cancellation = null ]) : Execution<TReceive, TSend>
Parameters
- $task : Task<TReceive, TSend>
-
The task to execute.
- $cancellation : Cancellation|null = null
-
Token to request cancellation. The task must support cancellation for this to have any effect.