Skip to content

Commit

Permalink
Merge pull request #7 from longxinH/master
Browse files Browse the repository at this point in the history
区别worker和task进程
  • Loading branch information
JanHuang committed May 8, 2018
2 parents 5ef4085 + 4ca0b35 commit 7ad87c7
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -601,9 +601,13 @@ public function onManagerStop(swoole_server $server)
*/
public function onWorkerStart(swoole_server $server, $worker_id)
{
process_rename($this->getName() . ' worker');

$this->output->writeln(sprintf('Server Worker[<info>%s</info>] is started [<info>%s</info>]', $server->worker_pid, $worker_id), OutputInterface::VERBOSITY_DEBUG);
if ($server->taskworker) {
process_rename($this->getName() . ' task');
$this->output->write(sprintf('Server Task[<info>%s</info>] is started [<info>%s</info>]', $server->worker_pid, $worker_id) . PHP_EOL);
} else {
process_rename($this->getName() . ' worker');
$this->output->write(sprintf('Server Worker[<info>%s</info>] is started [<info>%s</info>]', $server->worker_pid, $worker_id) . PHP_EOL);
}
}

/**
Expand Down

0 comments on commit 7ad87c7

Please sign in to comment.