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 25
__construct(int $delta = 0)
No description
at line 39
void
add(int $delta = 1)
Add to the counter (call before starting coroutines).
at line 56
void
done()
Decrement the counter (call when a coroutine completes).
at line 75
bool
wait(float $timeout = -1)
Block until the counter reaches zero.
at line 101
int
count()
Get the current counter value.