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
isTimeout()

Determine whether the last operation timed out.

Details

at line 16
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 22
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 32
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 37
int getCapacity()

Get the channel capacity.

Return Value

int

at line 42
int getLength()

Get the number of queued values.

Return Value

int

at line 47
bool isAvailable()

Determine whether the channel is available.

Return Value

bool

at line 52
bool hasProducers()

Determine whether producers are waiting.

Return Value

bool

at line 57
bool hasConsumers()

Determine whether consumers are waiting.

Return Value

bool

at line 62
bool isEmpty()

Determine whether the channel is empty.

Return Value

bool

at line 67
bool isFull()

Determine whether the channel is full.

Return Value

bool

at line 72
bool isReadable()

Determine whether the channel is readable.

Return Value

bool

at line 77
bool isWritable()

Determine whether the channel is writable.

Return Value

bool

at line 82
bool isClosing()

Determine whether the channel is closing or closed.

Return Value

bool

at line 87
bool isTimeout()

Determine whether the last operation timed out.

Return Value

bool