This commit is contained in:
as2252258@163.com
2021-02-28 00:41:22 +08:00
parent be1313cd4e
commit 69a8ad32cf
2 changed files with 8 additions and 6 deletions
+8 -1
View File
@@ -3,13 +3,14 @@ declare(strict_types=1);
namespace HttpServer\Events;
use co;
use Exception;
use HttpServer\Abstracts\Callback;
use Snowflake\Abstracts\Config;
use Snowflake\Event;
use Snowflake\Exception\ConfigException;
use Snowflake\Snowflake;
use Swoole\Coroutine;
use Swoole\Server;
/**
@@ -42,6 +43,12 @@ class OnWorkerStart extends Callback
swoole_set_process_name($get_name);
}
$container['enable_deadlock_check'] = false;
$container['exit_condition'] = function () {
return Co::stats()['coroutine_num'] === 0;
};
Coroutine::set($container);
// $this->onSignal($server, $worker_id);
if ($worker_id >= $server->setting['worker_num']) {
fire(Event::SERVER_TASK_START);