-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
104 changed files
with
747 additions
and
407 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
declare(strict_types = 1); | ||
/** | ||
* The file is part of Dcr/framework | ||
*/ | ||
|
||
namespace App\Console\Command; | ||
|
||
use App\Process\TestProcess; | ||
use Dcr\Process\ProcessManager; | ||
use Inhere\Console\Command; | ||
use Inhere\Console\IO\Input; | ||
use Inhere\Console\IO\Output; | ||
use Toolkit\PFlag\FlagsParser; | ||
|
||
/** | ||
* php artisan process | ||
*/ | ||
class ProcessCommand extends Command | ||
{ | ||
protected static string $name = 'process'; | ||
|
||
protected static string $desc = 'print system ENV information'; | ||
|
||
protected function configFlags(FlagsParser $fs): void | ||
{ | ||
} | ||
|
||
/** | ||
* @param Input $input | ||
* @param Output $output | ||
* | ||
* @throws \DI\DependencyException | ||
* @throws \DI\NotFoundException | ||
* 通过 pcntl_fork 实现 原生支持多进程 | ||
*/ | ||
protected function execute(Input $input, Output $output): void | ||
{ | ||
// pcntl_fork mac、win下面只支持一个 ,linux下支持 多个 | ||
// https://www.workerman.net/q/8638 workerman 下也有此问题 | ||
$processNum = 3; | ||
di()->get(ProcessManager::class)->run(TestProcess::class,$processNum); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.