Channel
class Channel
Store idle objects independently of execution mode and signal coroutine waiters.
Keep this in sync with the connection-pool channel in hypervel/pool.
Properties
| protected SplQueue<object> | $queue | ||
| protected Channel<bool> | $signal | ||
| protected int | $waiters | ||
| protected bool | $closed |
Methods
Create a pool channel.
Retrieve an idle object without waiting.
Push an idle object and wake one waiter.
Get the current number of objects 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 32
__construct(int $size)
Create a pool channel.
at line 41
false|object
pop()
Retrieve an idle object without waiting.
at line 49
bool
push(object $data)
Push an idle object and wake one waiter.
at line 64
int
length()
Get the current number of objects in the channel.
at line 72
bool
wait(float $timeout)
Wait for pool state to change.
at line 96
void
signal()
Wake one waiter after a capacity-relevant state change.
at line 118
protected void
pushSignal()
Push a coalesced wake signal without blocking on a full channel.
at line 128
void
close()
Close the signal channel and wake every waiter.