Concurrent
class Concurrent
Properties
| protected Channel | $channel |
Methods
No description
Proxy isFull() and isEmpty() to the channel.
Get the concurrency limit.
Get the current number of running coroutines.
Wait until a concurrency slot becomes available.
Create a new coroutine with concurrency limiting.
Create a new coroutine with concurrency limiting and parent context propagation.
Acquire one concurrency slot.
No description
No description
Details
at line 22
__construct(int $limit)
No description
at line 33
bool
__call(string $name, array $arguments)
Proxy isFull() and isEmpty() to the channel.
at line 45
int
getLimit()
Get the concurrency limit.
at line 53
int
getRunningCoroutineCount()
Get the current number of running coroutines.
at line 64
bool
waitForAvailableSlot(float $timeout = -1)
Wait until a concurrency slot becomes available.
The observed slot is released before this method returns. Another producer may claim it first, in which case create() will wait normally.
at line 88
void
create(callable $callable)
Create a new coroutine with concurrency limiting.
at line 98
void
fork(callable $callable, array $keys = [])
Create a new coroutine with concurrency limiting and parent context propagation.
at line 113
protected void
start(callable $callable, array|false $copyContext = false, Closure|null $wrapper = null)
Start a coroutine that owns one concurrency slot.
The optional wrapper runs at native child entry and must invoke the supplied runner exactly once. Outside the runner it must not wait for I/O or other work. Finalize ownership before notifying waiters, which may run immediately.
at line 149
protected void
acquireSlot()
Acquire one concurrency slot.
at line 18
bool
isFull()
No description
at line 18
bool
isEmpty()
No description