REDROOM
PHP 8.3.31
Path:
Logout
Edit File
Size: 2.32 KB
Close
/home/getspomw/royalsquad.us/vendor/laravel/framework/src/Illuminate/Concurrency/ProcessDriver.php
Text
Base64
<?php namespace Illuminate\Concurrency; use Closure; use Exception; use Illuminate\Console\Application; use Illuminate\Contracts\Concurrency\Driver; use Illuminate\Process\Factory as ProcessFactory; use Illuminate\Process\Pool; use Illuminate\Support\Arr; use Illuminate\Support\Defer\DeferredCallback; use Laravel\SerializableClosure\SerializableClosure; use function Illuminate\Support\defer; class ProcessDriver implements Driver { /** * Create a new process based concurrency driver. */ public function __construct(protected ProcessFactory $processFactory) { // } /** * Run the given tasks concurrently and return an array containing the results. */ public function run(Closure|array $tasks): array { $command = Application::formatCommandString('invoke-serialized-closure'); $results = $this->processFactory->pool(function (Pool $pool) use ($tasks, $command) { foreach (Arr::wrap($tasks) as $task) { $pool->path(base_path())->env([ 'LARAVEL_INVOKABLE_CLOSURE' => serialize(new SerializableClosure($task)), ])->command($command); } })->start()->wait(); return $results->collect()->map(function ($result) { if ($result->failed()) { throw new Exception('Concurrent process failed with exit code ['.$result->exitCode().']. Message: '.$result->errorOutput()); } $result = json_decode($result->output(), true); if (! $result['successful']) { throw new $result['exception']( $result['message'] ); } return unserialize($result['result']); })->all(); } /** * Start the given tasks in the background after the current task has finished. */ public function defer(Closure|array $tasks): DeferredCallback { $command = Application::formatCommandString('invoke-serialized-closure'); return defer(function () use ($tasks, $command) { foreach (Arr::wrap($tasks) as $task) { $this->processFactory->path(base_path())->env([ 'LARAVEL_INVOKABLE_CLOSURE' => serialize(new SerializableClosure($task)), ])->run($command.' 2>&1 &'); } }); } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 7
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
Console
DIR
-
drwxrwxrwx
2025-09-17 06:52:59
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
composer.json
964 B
lrw-rw-rw-
2025-09-17 06:52:59
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ConcurrencyManager.php
2.54 KB
lrw-rw-rw-
2025-09-17 06:52:59
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ConcurrencyServiceProvider.php
692 B
lrw-rw-rw-
2025-09-17 06:52:59
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ForkDriver.php
773 B
lrw-rw-rw-
2025-09-17 06:52:59
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
LICENSE.md
1.05 KB
lrw-rw-rw-
2025-09-17 06:52:59
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ProcessDriver.php
2.32 KB
lrw-rw-rw-
2025-09-17 06:52:59
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
SyncDriver.php
790 B
lrw-rw-rw-
2025-09-17 06:52:59
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).