改名
This commit is contained in:
@@ -30,6 +30,7 @@ class DatabasesProviders extends Providers
|
||||
|
||||
$event = Snowflake::app()->getEvent();
|
||||
$event->on(Event::SERVER_WORKER_START, [$this, 'createPool']);
|
||||
$event->on(Event::SERVER_TASK_START, [$this, 'createPool']);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -35,6 +35,7 @@ class OnWorkerStart extends Callback
|
||||
swoole_set_process_name($get_name);
|
||||
}
|
||||
if ($worker_id >= $server->setting['worker_num']) {
|
||||
fire(Event::SERVER_TASK_START);
|
||||
return;
|
||||
}
|
||||
Snowflake::setWorkerId($server->worker_pid);
|
||||
|
||||
@@ -39,6 +39,7 @@ class Redis extends Component
|
||||
$event->on(Event::RELEASE_ALL, [$this, 'destroy']);
|
||||
$event->on(Event::EVENT_AFTER_REQUEST, [$this, 'release']);
|
||||
$event->on(Event::SERVER_WORKER_START, [$this, 'createPool']);
|
||||
$event->on(Event::SERVER_TASK_START, [$this, 'createPool']);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -43,6 +43,7 @@ class Event extends BaseObject
|
||||
const SERVER_MANAGER_STOP = 'SERVER:EVENT:MANAGER:START';
|
||||
const SERVER_WORKER_STOP = 'SERVER:EVENT:WORKER:STOP';
|
||||
const SERVER_WORKER_START = 'SERVER:EVENT:WORKER:START';
|
||||
const SERVER_TASK_START = 'SERVER:EVENT:TASK:START';
|
||||
const SERVER_WORKER_EXIT = 'SERVER:EVENT:WORKER:EXIT';
|
||||
const SERVER_WORKER_ERROR = 'SERVER:EVENT:WORKER:ERROR';
|
||||
const SERVER_SHUTDOWN = 'SERVER:EVENT:SHUTDOWN';
|
||||
|
||||
Reference in New Issue
Block a user