File tree Expand file tree Collapse file tree 4 files changed +9
-5
lines changed Expand file tree Collapse file tree 4 files changed +9
-5
lines changed Original file line number Diff line number Diff line change 3
3
namespace Illuminate \Concurrency ;
4
4
5
5
use Closure ;
6
+ use Illuminate \Contracts \Concurrency \Driver ;
6
7
use Illuminate \Foundation \Defer \DeferredCallback ;
7
8
use Illuminate \Support \Arr ;
8
9
use Spatie \Fork \Fork ;
9
10
10
- class ForkDriver
11
+ class ForkDriver implements Driver
11
12
{
12
13
/**
13
14
* Run the given tasks concurrently and return an array containing the results.
Original file line number Diff line number Diff line change 3
3
namespace Illuminate \Concurrency ;
4
4
5
5
use Closure ;
6
+ use Illuminate \Contracts \Concurrency \Driver ;
6
7
use Illuminate \Foundation \Defer \DeferredCallback ;
7
8
use Illuminate \Process \Factory as ProcessFactory ;
8
9
use Illuminate \Process \Pool ;
9
10
use Illuminate \Support \Arr ;
10
11
use Laravel \SerializableClosure \SerializableClosure ;
11
12
use Symfony \Component \Process \PhpExecutableFinder ;
12
13
13
- class ProcessDriver
14
+ class ProcessDriver implements Driver
14
15
{
15
16
/**
16
17
* Create a new process based concurrency driver.
Original file line number Diff line number Diff line change 3
3
namespace Illuminate \Concurrency ;
4
4
5
5
use Closure ;
6
+ use Illuminate \Contracts \Concurrency \Driver ;
6
7
use Illuminate \Foundation \Defer \DeferredCallback ;
7
8
use Illuminate \Support \Arr ;
8
9
9
- class SyncDriver
10
+ class SyncDriver implements Driver
10
11
{
11
12
/**
12
13
* Run the given tasks concurrently and return an array containing the results.
Original file line number Diff line number Diff line change 3
3
namespace Illuminate \Contracts \Concurrency ;
4
4
5
5
use Closure ;
6
+ use Illuminate \Foundation \Defer \DeferredCallback ;
6
7
7
8
interface Driver
8
9
{
@@ -12,7 +13,7 @@ interface Driver
12
13
public function run (Closure |array $ tasks ): array ;
13
14
14
15
/**
15
- * Start the given tasks in the background .
16
+ * Defer the execution of the given tasks .
16
17
*/
17
- public function background (Closure |array $ tasks ): void ;
18
+ public function defer (Closure |array $ tasks ): DeferredCallback ;
18
19
}
You can’t perform that action at this time.
0 commit comments