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 timed out.
Details
at line 24
bool
push(mixed $data, float $timeout = -1)
Push data into the channel.
at line 35
mixed
pop(float $timeout = -1)
Pop data from the channel.
at line 43
int
getCapacity()
Get the channel capacity.
at line 51
int
getLength()
Get the current length of the channel.
at line 59
bool
isAvailable()
Determine if the channel is available.
at line 71
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 82
bool
hasProducers()
Determine if the channel has producers waiting.
at line 92
bool
hasConsumers()
Determine if the channel has consumers waiting.
at line 102
bool
isReadable()
Determine if the channel is readable.
at line 112
bool
isWritable()
Determine if the channel is writable.
at line 120
bool
isClosing()
Determine if the channel is closing or closed.
at line 128
bool
isTimeout()
Determine if the last operation timed out.