diff --git a/src/Runner.php b/src/Runner.php index dfe2331..0534656 100644 --- a/src/Runner.php +++ b/src/Runner.php @@ -62,7 +62,7 @@ public function run(): int group: $config['group'], name: $processConfig['name'], command: $processConfig['command'], - processes: $processConfig['processes'], + count: $processConfig['count'], )); } diff --git a/src/Worker/ProcessWorker.php b/src/Worker/ProcessWorker.php index db05600..a606d2d 100644 --- a/src/Worker/ProcessWorker.php +++ b/src/Worker/ProcessWorker.php @@ -18,11 +18,11 @@ public function __construct( string|null $group, string|null $name, private readonly string $command, - int $processes, + int $count, ) { parent::__construct( name: $name ?? $command, - count: $processes, + count: $count, user: $user, group: $group, onStart: $this->onStart(...), diff --git a/src/Worker/SchedulerWorker.php b/src/Worker/SchedulerWorker.php index b58b6ee..733dcaf 100644 --- a/src/Worker/SchedulerWorker.php +++ b/src/Worker/SchedulerWorker.php @@ -138,9 +138,7 @@ private function runSymfonyCommand(Application $application, string $command): i } // Execute in a forked process - $identifiers = $this->getEventLoop()->getIdentifiers(); - \array_walk($identifiers, $this->getEventLoop()->disable(...)); - $this->getEventLoop()->stop(); + $this->detach(); \cli_set_process_title($command); \pcntl_signal(SIGINT, SIG_IGN); diff --git a/src/config/configuration.php b/src/config/configuration.php index afc0a87..f4b39a1 100644 --- a/src/config/configuration.php +++ b/src/config/configuration.php @@ -96,6 +96,10 @@ ->isRequired() ->cannotBeEmpty() ->end() + ->integerNode('count') + ->info('Processes count') + ->defaultValue(1) + ->end() ->end() ->end() ->end()