Skip to content

Commit

Permalink
delegate defer to run method (#52807)
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigopedra authored Sep 16, 2024
1 parent 881b28d commit 79fbf4a
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions src/Illuminate/Concurrency/ProcessDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,20 +59,7 @@ public function run(Closure|array $tasks): array
*/
public function defer(Closure|array $tasks): DeferredCallback
{
$php = $this->phpBinary();
$artisan = $this->artisanBinary();

return defer(function () use ($tasks, $php, $artisan) {
foreach (Arr::wrap($tasks) as $task) {
$this->processFactory->path(base_path())->env([
'LARAVEL_INVOKABLE_CLOSURE' => serialize(new SerializableClosure($task)),
])->run([
$php,
$artisan,
'invoke-serialized-closure 2>&1 &',
]);
}
});
return defer(fn () => $this->run($tasks));
}

/**
Expand Down

0 comments on commit 79fbf4a

Please sign in to comment.