Concurrency: Allow custom timeout settings #52853
Replies: 3 comments 1 reply
-
EDIT: looking into the code, I see EDIT2: it also has |
Beta Was this translation helpful? Give feedback.
-
Unfortunately, we can't interact with this class directly when using the For example this code: [$userCount, $orderCount] = Concurrency::timeout(300)->run([
fn () => 10,
fn () => 20,
]); Throw this error:
|
Beta Was this translation helpful? Give feedback.
-
A bit late to the party, but here is what I did: app()->bind(Illuminate\Process\Factory::class, function () {
return new class extends Illuminate\Process\Factory
{
public function newPendingProcess()
{
return parent::newPendingProcess()->forever();
}
};
}); You can use this snippet at the very beginning of a controller or globally in |
Beta Was this translation helpful? Give feedback.
-
Currently, it's not possible to run tasks in
Concurrency
that take longer than 60 seconds to complete. This limitation stems from this line in the Laravel framework:https://github.com/laravel/framework/blob/11.x/src/Illuminate/Process/PendingProcess.php#L44
It would be helpful to allow custom timeouts for tasks. For example:
This way, developers could set a timeout for long-running tasks as needed.
Beta Was this translation helpful? Give feedback.
All reactions