Channel
class Channel
Store idle connections independently of execution mode and signal coroutine waiters.
Keep this in sync with the object-pool channel in hypervel/object-pool.
Properties
| protected ConnectionInterface> | $queue | ||
| protected Channel<bool> | $signal | ||
| protected int | $waiters | ||
| protected bool | $closed |
Methods
Create a pool channel.
Pop an idle connection without waiting.
Get the number of connections in the channel.
Wait for pool state to change.
Wake one waiter after a capacity-relevant state change.
Push a coalesced wake signal without blocking on a full channel.
Close the signal channel and wake every waiter.
Details
at line 33
__construct(int $size)
Create a pool channel.
at line 42
ConnectionInterface|false
pop()
Pop an idle connection without waiting.
at line 50
bool
push(ConnectionInterface $data)
Push an idle connection and wake one waiter.
at line 65
int
length()
Get the number of connections in the channel.
at line 73
bool
wait(float $timeout)
Wait for pool state to change.
at line 97
void
signal()
Wake one waiter after a capacity-relevant state change.
at line 119
protected void
pushSignal()
Push a coalesced wake signal without blocking on a full channel.
at line 129
void
close()
Close the signal channel and wake every waiter.