WaitGroup
class WaitGroup
Go-style WaitGroup for waiting on multiple coroutines.
Based on swoole/library implementation.
Properties
| protected Channel | $chan | ||
| protected int | $count | ||
| protected bool | $waiting |
Methods
__construct(int $delta = 0)
No description
void
add(int $delta = 1)
Add to the counter (call before starting coroutines).
void
done()
Decrement the counter (call when a coroutine completes).
bool
wait(float $timeout = -1)
Block until the counter reaches zero.
int
count()
Get the current counter value.
Details
at line 24
__construct(int $delta = 0)
No description
at line 38
void
add(int $delta = 1)
Add to the counter (call before starting coroutines).
at line 55
void
done()
Decrement the counter (call when a coroutine completes).
at line 74
bool
wait(float $timeout = -1)
Block until the counter reaches zero.
at line 91
int
count()
Get the current counter value.