Documentation

AbstractContext
in package
implements Context uses ForbidCloning, ForbidSerialization

AbstractYes
Tags
template-covariant
template-covariant
template
implements

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

Methods

__unserialize()

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

close()

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.


        
On this page

Search results