Parallel
class Parallel
Properties
| protected array<array-key, callable> | $callbacks | ||
| protected Channel|null | $concurrentChannel | ||
| protected array | $results | ||
| protected Throwable> | $throwables |
Methods
Create a new parallel executor.
Add a callback to be executed in parallel.
Execute all callbacks in parallel and wait for completion.
Get the number of registered callbacks.
Get the throwables captured from the most recent wait() call, keyed by callback key.
Determine if the most recent wait() call captured any throwables.
Get the number of throwables captured from the most recent wait() call.
Clear all callbacks, results, and throwables.
Details
at line 38
__construct(int $concurrent = 0, bool|array $copyContext = false)
Create a new parallel executor.
at line 50
void
add(callable $callable, int|string|null $key = null)
Add a callback to be executed in parallel.
at line 66
array
wait(bool $throw = true)
Execute all callbacks in parallel and wait for completion.
at line 127
int
count()
Get the number of registered callbacks.
at line 137
array
getThrowables()
Get the throwables captured from the most recent wait() call, keyed by callback key.
at line 145
bool
hasFailures()
Determine if the most recent wait() call captured any throwables.
at line 153
int
failedCount()
Get the number of throwables captured from the most recent wait() call.
at line 161
void
clear()
Clear all callbacks, results, and throwables.