Channel
class Channel extends Channel implements ChannelInterface
Properties
| protected bool | $closed |
Methods
Push data into the channel.
Pop data from the channel.
Get the channel capacity.
Get the current length of the channel.
Determine if the channel is available.
Close the channel.
Determine if the channel has producers waiting.
Determine if the channel has consumers waiting.
Determine if the channel is readable.
Determine if the channel is writable.
Determine if the channel is closing or closed.
Determine if the last operation was canceled.
Determine if the last operation timed out.
Details
at line 25
bool
push(mixed $data, float $timeout = -1)
Push data into the channel.
at line 37
mixed
pop(float $timeout = -1)
Pop data from the channel.
at line 45
int
getCapacity()
Get the channel capacity.
at line 53
int
getLength()
Get the current length of the channel.
at line 61
bool
isAvailable()
Determine if the channel is available.
at line 75
bool
close()
Close the channel.
Call only from a deterministic lifecycle path while the Swoole runtime is live. Native channel methods are uncatchably fatal after the native handle is torn down, so destructors must not call this method.
at line 86
bool
hasProducers()
Determine if the channel has producers waiting.
at line 96
bool
hasConsumers()
Determine if the channel has consumers waiting.
at line 106
bool
isReadable()
Determine if the channel is readable.
at line 116
bool
isWritable()
Determine if the channel is writable.
at line 124
bool
isClosing()
Determine if the channel is closing or closed.
at line 134
bool
isCanceled()
Determine if the last operation was canceled.
This state must be inspected immediately after a failed operation.
at line 142
bool
isTimeout()
Determine if the last operation timed out.