Parallel
class Parallel
Properties
| protected array<array-key, callable> | $callbacks | ||
| protected Channel|null | $concurrentChannel | ||
| protected array<array-key, mixed> | $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 48
__construct(int $concurrent = 0, bool|array $copyContext = false)
Create a new parallel executor.
at line 60
void
add(callable $callable, int|string|null $key = null)
Add a callback to be executed in parallel.
at line 77
array
wait(bool $throw = true)
Execute all callbacks in parallel and wait for completion.
at line 212
int
count()
Get the number of registered callbacks.
at line 222
array
getThrowables()
Get the throwables captured from the most recent wait() call, keyed by callback key.
at line 230
bool
hasFailures()
Determine if the most recent wait() call captured any throwables.
at line 238
int
failedCount()
Get the number of throwables captured from the most recent wait() call.
at line 246
void
clear()
Clear all callbacks, results, and throwables.