This commit is contained in:
2020-08-31 15:07:37 +08:00
parent 81130960d3
commit db0005f136
2 changed files with 5 additions and 6 deletions
+3 -4
View File
@@ -27,10 +27,9 @@ class Processes extends Component
*/
public function initCore()
{
$application = Snowflake::get();
$server = $application->set(Pool::class, new Pool($this->size(), SWOOLE_IPC_UNIXSOCK));
$server->on('workerStart', function (Pool $pool, int $workerId) use ($application) {
ServerManager::create($pool, $this->processes[$workerId], $application, $workerId);
$server = new Pool($this->size(), SWOOLE_IPC_UNIXSOCK);
$server->on('workerStart', function (Pool $pool, int $workerId) {
ServerManager::create($pool, $this->processes[$workerId], $workerId);
});
$server->on('workerStop', function (Pool $pool, int $workerId) {
$event = Snowflake::get()->event;