Skip to content

Commit

Permalink
Optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
walkor committed Dec 19, 2024
1 parent cf97712 commit d86dd6b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/Worker.php
Original file line number Diff line number Diff line change
Expand Up @@ -1568,8 +1568,8 @@ protected static function forkWorkersForWindows(): void

// Create a global event loop.
if (static::$globalEvent === null) {
$eventLoopClass = $worker->eventLoop ?: static::$eventLoopClass;
static::$globalEvent = new $eventLoopClass();
static::$eventLoopClass = $worker->eventLoop ?: static::$eventLoopClass;
static::$globalEvent = new static::$eventLoopClass();
static::$globalEvent->setErrorHandler(function ($exception) {
static::stopAll(250, $exception);
});
Expand Down Expand Up @@ -1708,8 +1708,8 @@ protected static function forkOneWorkerForLinux(self $worker): void

// Create a global event loop.
if (static::$globalEvent === null) {
$eventLoopClass = $worker->eventLoop ?: static::$eventLoopClass;
static::$globalEvent = new $eventLoopClass();
static::$eventLoopClass = $worker->eventLoop ?: static::$eventLoopClass;
static::$globalEvent = new static::$eventLoopClass();
static::$globalEvent->setErrorHandler(function ($exception) {
static::stopAll(250, $exception);
});
Expand Down

0 comments on commit d86dd6b

Please sign in to comment.