mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-20 23:25:35 +08:00
strict SignalListener param type
This commit is contained in:
@@ -45,7 +45,7 @@ use ZM\Utils\SignalListener;
|
||||
*/
|
||||
class OnWorkerStart implements SwooleEvent
|
||||
{
|
||||
public function onCall(Server $server, $worker_id)
|
||||
public function onCall(Server $server, int $worker_id)
|
||||
{
|
||||
Console::debug('Calling onWorkerStart event(1)');
|
||||
if (!Framework::$argv['disable-safe-exit']) {
|
||||
|
||||
@@ -63,9 +63,9 @@ class SignalListener
|
||||
|
||||
/**
|
||||
* 监听Worker/TaskWorker进程的Ctrl+C
|
||||
* @param int|string $worker_id 当前进程的ID
|
||||
* @param int $worker_id 当前进程的ID
|
||||
*/
|
||||
public static function signalWorker(Server $server, $worker_id)
|
||||
public static function signalWorker(Server $server, int $worker_id)
|
||||
{
|
||||
Console::debug('Listening Worker #' . $worker_id . ' SIGINT');
|
||||
Process::signal(SIGINT, function () use ($server) {
|
||||
|
||||
Reference in New Issue
Block a user