Documentation

Execution
in package
uses ForbidCloning, ForbidSerialization

FinalYes
Tags
template-covariant
template
template

Table of Contents

Properties

$channel  : Channel
$future  : Future
$task  : Task

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

Methods

__construct()

public __construct(Task<TReceive, TSend$task, Channel<TSend, TReceive$channel, Future<string|int, TResult$future) : mixed
Parameters
$task : Task<TReceive, TSend>
$channel : Channel<TSend, TReceive>
$future : Future<string|int, TResult>

__unserialize()

public final __unserialize(array<string|int, mixed> $data) : never
Parameters
$data : array<string|int, mixed>
Return values
never

await()

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
TResult

getChannel()

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>

        
On this page

Search results