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.

Table of Contents


Namespace

OpenFGA\Network


Source

View source code


Methods

execute

public function execute(
    array<callable(): (FailureInterface|SuccessInterface)> $tasks,
    int $maxParallelRequests,
    bool $stopOnFirstError,
): array<FailureInterface|SuccessInterface>

Execute tasks with specified parallelism.

View source


Parameters

Name Type Description
$tasks array&lt;callable(): (FailureInterface | SuccessInterface)&gt;
$maxParallelRequests int Maximum concurrent requests
$stopOnFirstError bool Whether to stop on first error

Returns

array&lt;FailureInterface | SuccessInterface&gt; — Results from each task

⚠️ **GitHub.com Fallback** ⚠️