phasync
WaitGroup / add

Method

WaitGroup::add

Adds $delta to the counter of unfinished work.

Description#

public WaitGroup::add(
    int $delta = 1
): void

A negative delta marks work as done. When the counter reaches zero, the waiting coroutines resume.

Parameters#

$delta int = 1
The amount of work to add

Errors / Exceptions#

ExceptionWhen
LogicExceptionIf the counter would become negative

See also#