interface ChannelInterface

Methods

bool
push(mixed $data, float $timeout = -1)

No description

mixed
pop(float $timeout = -1)

No description

bool
close()

Close the channel.

int
getCapacity()

Get the channel capacity.

int
getLength()

Get the number of queued values.

bool
isAvailable()

Determine whether the channel is available.

bool
hasProducers()

Determine whether producers are waiting.

bool
hasConsumers()

Determine whether consumers are waiting.

bool
isEmpty()

Determine whether the channel is empty.

bool
isFull()

Determine whether the channel is full.

bool
isReadable()

Determine whether the channel is readable.

bool
isWritable()

Determine whether the channel is writable.

bool
isClosing()

Determine whether the channel is closing or closed.

bool
isCanceled()

Determine whether the last operation was canceled.

bool
isTimeout()

Determine whether the last operation timed out.

Details

at line 17
bool push(mixed $data, float $timeout = -1)

No description

Parameters

mixed $data
float $timeout

Timeout in seconds (values less than or equal to zero wait indefinitely)

Return Value

bool

at line 24
mixed pop(float $timeout = -1)

No description

Parameters

float $timeout

Timeout in seconds (values less than or equal to zero wait indefinitely)

Return Value

mixed

Returns false when pop fails

at line 36
bool close()

Close the channel.

Data in the channel can still be popped out after closing, but push will no longer succeed. Native-backed channels must be closed from a deterministic lifecycle path while the runtime is active, never from a destructor after native teardown.

Return Value

bool

at line 41
int getCapacity()

Get the channel capacity.

Return Value

int

at line 46
int getLength()

Get the number of queued values.

Return Value

int

at line 51
bool isAvailable()

Determine whether the channel is available.

Return Value

bool

at line 56
bool hasProducers()

Determine whether producers are waiting.

Return Value

bool

at line 61
bool hasConsumers()

Determine whether consumers are waiting.

Return Value

bool

at line 66
bool isEmpty()

Determine whether the channel is empty.

Return Value

bool

at line 71
bool isFull()

Determine whether the channel is full.

Return Value

bool

at line 76
bool isReadable()

Determine whether the channel is readable.

Return Value

bool

at line 81
bool isWritable()

Determine whether the channel is writable.

Return Value

bool

at line 86
bool isClosing()

Determine whether the channel is closing or closed.

Return Value

bool

at line 93
bool isCanceled()

Determine whether the last operation was canceled.

This state must be inspected immediately after a failed operation.

Return Value

bool

at line 98
bool isTimeout()

Determine whether the last operation timed out.

Return Value

bool