This commit is contained in:
2020-12-28 18:27:45 +08:00
parent cabdd0ba83
commit 4f488580b1
2 changed files with 6 additions and 5 deletions
+6 -1
View File
@@ -29,7 +29,12 @@ abstract class Process extends \Swoole\Process
*/
public function __construct($application, $name, $enable_coroutine = true)
{
parent::__construct(function ($process) use ($name) {
$class = get_called_class();
parent::__construct(function ($process) use ($name, $class) {
if (Snowflake::isLinux()) {
$prefix = ucfirst(rtrim(Snowflake::app()->id, ':'));
$this->name($prefix . ': ' . $class);
}
$this->onHandler($process);
}, false, 1, $enable_coroutine);
$this->application = $application;