API Network ParallelTaskExecutor - evansims/openfga-php GitHub Wiki
Executes tasks in parallel using the RequestManager infrastructure. This class provides a clean abstraction for parallel task execution, leveraging the existing Fiber-based implementation in RequestManager.
OpenFGA\Network
public function execute(
array<callable(): (FailureInterface|SuccessInterface)> $tasks,
int $maxParallelRequests,
bool $stopOnFirstError,
): array<FailureInterface|SuccessInterface>
Execute tasks with specified parallelism.
Name | Type | Description |
---|---|---|
$tasks |
array<callable(): (FailureInterface | SuccessInterface)>
|
|
$maxParallelRequests |
int |
Maximum concurrent requests |
$stopOnFirstError |
bool |
Whether to stop on first error |
array<FailureInterface
| SuccessInterface>
— Results from each task