modify
This commit is contained in:
@@ -3,13 +3,14 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace HttpServer\Events;
|
namespace HttpServer\Events;
|
||||||
|
|
||||||
|
use co;
|
||||||
use Exception;
|
use Exception;
|
||||||
use HttpServer\Abstracts\Callback;
|
use HttpServer\Abstracts\Callback;
|
||||||
use Snowflake\Abstracts\Config;
|
use Snowflake\Abstracts\Config;
|
||||||
use Snowflake\Event;
|
use Snowflake\Event;
|
||||||
use Snowflake\Exception\ConfigException;
|
use Snowflake\Exception\ConfigException;
|
||||||
use Snowflake\Snowflake;
|
use Snowflake\Snowflake;
|
||||||
|
use Swoole\Coroutine;
|
||||||
use Swoole\Server;
|
use Swoole\Server;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -42,6 +43,12 @@ class OnWorkerStart extends Callback
|
|||||||
swoole_set_process_name($get_name);
|
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);
|
// $this->onSignal($server, $worker_id);
|
||||||
if ($worker_id >= $server->setting['worker_num']) {
|
if ($worker_id >= $server->setting['worker_num']) {
|
||||||
fire(Event::SERVER_TASK_START);
|
fire(Event::SERVER_TASK_START);
|
||||||
|
|||||||
@@ -216,11 +216,6 @@ class Server extends HttpService
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Runtime::enableCoroutine(true, $this->_types);
|
Runtime::enableCoroutine(true, $this->_types);
|
||||||
$container['enable_deadlock_check'] = false;
|
|
||||||
$container['exit_condition'] = function () {
|
|
||||||
return Co::stats()['coroutine_num'] === 0;
|
|
||||||
};
|
|
||||||
Coroutine::set($container);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user