Execution
in package
uses
ForbidCloning, ForbidSerialization
FinalYes
Tags
Table of Contents
Properties
Methods
- __construct() : mixed
- __serialize() : never
- __unserialize() : never
- await() : TResult
- Shortcut to calling {@see self::getFuture()::await()}. Cancellation only cancels awaiting the result, it does not cancel the task. Use the cancellation passed to {@see Worker::submit()} to cancel the task.
- getChannel() : Channel<TSend, TReceive>
- Communication channel to the task. The other end of this channel is provided to {@see Task::run()}.
- getFuture() : Future<string|int, TResult>
- Return value from {@see Task::run()}.
- getTask() : Task<TReceive, TSend>
- __clone() : mixed
Properties
$channel read-only
private
Channel
$channel
$future read-only
private
Future
$future
$task read-only
private
Task
$task
Methods
__construct()
public
__construct(Task<TReceive, TSend> $task, Channel<TSend, TReceive> $channel, Future<string|int, TResult> $future) : mixed
Parameters
__serialize()
public
final __serialize() : never
Return values
never__unserialize()
public
final __unserialize(array<string|int, mixed> $data) : never
Parameters
- $data : array<string|int, mixed>
Return values
neverawait()
Shortcut to calling {@see self::getFuture()::await()}. Cancellation only cancels awaiting the result, it does not cancel the task. Use the cancellation passed to {@see Worker::submit()} to cancel the task.
public
await([Cancellation|null $cancellation = null ]) : TResult
Parameters
- $cancellation : Cancellation|null = null
Return values
TResultgetChannel()
Communication channel to the task. The other end of this channel is provided to {@see Task::run()}.
public
getChannel() : Channel<TSend, TReceive>
Return values
Channel<TSend, TReceive>getFuture()
Return value from {@see Task::run()}.
public
getFuture() : Future<string|int, TResult>
Return values
Future<string|int, TResult>getTask()
public
getTask() : Task<TReceive, TSend>
Return values
Task<TReceive, TSend>__clone()
protected
final __clone() : mixed