REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 1.78 KB
Close
/opt/cpanel/ea-wappspector/vendor/rector/rector/vendor/symplify/easy-parallel/src/ValueObject/ProcessPool.php
Text
Base64
<?php declare (strict_types=1); namespace RectorPrefix202411\Symplify\EasyParallel\ValueObject; use RectorPrefix202411\React\Socket\TcpServer; use RectorPrefix202411\Symplify\EasyParallel\Exception\ParallelShouldNotHappenException; /** * Used from https://github.com/phpstan/phpstan-src/blob/master/src/Parallel/ProcessPool.php * * @api */ final class ProcessPool { /** * @readonly * @var \React\Socket\TcpServer */ private $tcpServer; /** * @var array<string, ParallelProcess> */ private $processes = []; public function __construct(TcpServer $tcpServer) { $this->tcpServer = $tcpServer; } public function getProcess(string $identifier) : ParallelProcess { if (!\array_key_exists($identifier, $this->processes)) { throw new ParallelShouldNotHappenException(\sprintf('Process "%s" not found.', $identifier)); } return $this->processes[$identifier]; } public function attachProcess(string $identifier, ParallelProcess $parallelProcess) : void { $this->processes[$identifier] = $parallelProcess; } public function tryQuitProcess(string $identifier) : void { if (!\array_key_exists($identifier, $this->processes)) { return; } $this->quitProcess($identifier); } public function quitProcess(string $identifier) : void { $parallelProcess = $this->getProcess($identifier); $parallelProcess->quit(); unset($this->processes[$identifier]); if ($this->processes !== []) { return; } $this->tcpServer->close(); } public function quitAll() : void { foreach (\array_keys($this->processes) as $identifier) { $this->quitProcess($identifier); } } }
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 4
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
EasyParallelConfig.php
251 B
lrw-r--r--
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ParallelProcess.php
4.58 KB
lrw-r--r--
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ProcessPool.php
1.78 KB
lrw-r--r--
2024-11-08 13:59:10
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Schedule.php
930 B
lrw-r--r--
2024-11-08 13:59:10
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).