Skip to content

Commit

Permalink
fix drivers
Browse files Browse the repository at this point in the history
  • Loading branch information
taylorotwell committed Sep 12, 2024
1 parent 73f36e1 commit ab41b23
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 5 deletions.
3 changes: 2 additions & 1 deletion src/Illuminate/Concurrency/ForkDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@
namespace Illuminate\Concurrency;

use Closure;
use Illuminate\Contracts\Concurrency\Driver;
use Illuminate\Foundation\Defer\DeferredCallback;
use Illuminate\Support\Arr;
use Spatie\Fork\Fork;

class ForkDriver
class ForkDriver implements Driver
{
/**
* Run the given tasks concurrently and return an array containing the results.
Expand Down
3 changes: 2 additions & 1 deletion src/Illuminate/Concurrency/ProcessDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@
namespace Illuminate\Concurrency;

use Closure;
use Illuminate\Contracts\Concurrency\Driver;
use Illuminate\Foundation\Defer\DeferredCallback;
use Illuminate\Process\Factory as ProcessFactory;
use Illuminate\Process\Pool;
use Illuminate\Support\Arr;
use Laravel\SerializableClosure\SerializableClosure;
use Symfony\Component\Process\PhpExecutableFinder;

class ProcessDriver
class ProcessDriver implements Driver
{
/**
* Create a new process based concurrency driver.
Expand Down
3 changes: 2 additions & 1 deletion src/Illuminate/Concurrency/SyncDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
namespace Illuminate\Concurrency;

use Closure;
use Illuminate\Contracts\Concurrency\Driver;
use Illuminate\Foundation\Defer\DeferredCallback;
use Illuminate\Support\Arr;

class SyncDriver
class SyncDriver implements Driver
{
/**
* Run the given tasks concurrently and return an array containing the results.
Expand Down
5 changes: 3 additions & 2 deletions src/Illuminate/Contracts/Concurrency/Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Illuminate\Contracts\Concurrency;

use Closure;
use Illuminate\Foundation\Defer\DeferredCallback;

interface Driver
{
Expand All @@ -12,7 +13,7 @@ interface Driver
public function run(Closure|array $tasks): array;

/**
* Start the given tasks in the background.
* Defer the execution of the given tasks.
*/
public function background(Closure|array $tasks): void;
public function defer(Closure|array $tasks): DeferredCallback;
}

0 comments on commit ab41b23

Please sign in to comment.