class CoroutineDriver implements Driver

Methods

array
run(Closure|array $tasks, CarbonInterval|int|null $timeout = null)

Run the given tasks concurrently and return an array containing the results.

defer(Closure|array $tasks)

Start the given tasks concurrently in the background after the current task has finished.

Details

at line 27
array run(Closure|array $tasks, CarbonInterval|int|null $timeout = null)

Run the given tasks concurrently and return an array containing the results.

Each task runs in its own coroutine with the parent's context propagated. Results are keyed to match the input array. If any task throws, the exception is re-thrown after all tasks complete.

Parameters

Closure|array $tasks
CarbonInterval|int|null $timeout

Return Value

array

at line 82
DeferredCallback defer(Closure|array $tasks)

Start the given tasks concurrently in the background after the current task has finished.

Uses Hypervel's lifecycle-aware defer system so tasks execute at the appropriate lifecycle point (after HTTP response, after command completion). Each deferred task runs in its own coroutine with context propagated.

Parameters

Closure|array $tasks

Return Value

DeferredCallback