AbstractContext
in package
implements
Context
uses
ForbidCloning, ForbidSerialization
AbstractYes
Tags
Table of Contents
Interfaces
- Context
- Interface for sending messages between execution contexts, such as two coroutines or two processes.
Properties
- $ipcChannel : Channel
- $result : Future<string|int, ExitResult<string|int, TResult>>|null
- $resultChannel : Channel
Methods
- __serialize() : never
- __unserialize() : never
- close() : void
- Closes the resource, marking it as unusable.
- isClosed() : bool
- Returns whether this resource has been closed.
- onClose() : void
- Registers a callback that is invoked when this resource is closed.
- receive() : TReceive
- send() : void
- __clone() : mixed
- __construct() : mixed
- receiveExitResult() : ExitResult
Properties
$ipcChannel read-only
private
Channel
$ipcChannel
$result
private
Future<string|int, ExitResult<string|int, TResult>>|null
$result
= null
$resultChannel read-only
private
Channel
$resultChannel
Methods
__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
neverclose()
Closes the resource, marking it as unusable.
public
close() : void
Whether pending operations are aborted or not is implementation dependent.
isClosed()
Returns whether this resource has been closed.
public
isClosed() : bool
Return values
bool —true if closed, otherwise false.
onClose()
Registers a callback that is invoked when this resource is closed.
public
onClose(Closure $onClose) : void
Parameters
- $onClose : Closure
receive()
public
receive([Cancellation|null $cancellation = null ]) : TReceive
Parameters
- $cancellation : Cancellation|null = null
-
Cancels waiting for the next value. Note the next value is not discarded if the operation is cancelled, rather it will be returned from the next call to this method.
Return values
TReceive —Data received.
send()
public
send(mixed $data) : void
Parameters
- $data : mixed
__clone()
protected
final __clone() : mixed
__construct()
protected
__construct(Channel $ipcChannel, Channel $resultChannel) : mixed
Parameters
receiveExitResult()
protected
receiveExitResult([Cancellation|null $cancellation = null ]) : ExitResult
Parameters
- $cancellation : Cancellation|null = null