Fixed bug that process does not works in swow server. (#2741)

* Fixed bug that process does not works in swow server.

* Update CHANGELOG-2.1.md
This commit is contained in:
李铭昕 2020-10-31 10:49:05 +08:00 committed by GitHub
parent d0db944c9b
commit 5cab34c07b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 2 deletions

View File

@ -44,3 +44,7 @@
- [#2659](https://github.com/hyperf/hyperf/pull/2659) [#2663](https://github.com/hyperf/hyperf/pull/2663) Support `HttpServer` for [Swow](https://github.com/swow/swow).
- [#2671](https://github.com/hyperf/hyperf/pull/2671) Added `Hyperf\AsyncQueue\Listener\QueueHandleListener` which can record running logs for async-queue.
## Fixed
- [#2741](https://github.com/hyperf/hyperf/pull/2741) Fixed bug that process does not works in swow server.

View File

@ -13,6 +13,7 @@ namespace Hyperf\Process;
use Hyperf\Contract\ProcessInterface;
use Hyperf\Contract\StdoutLoggerInterface;
use Hyperf\Engine\Constant;
use Hyperf\ExceptionHandler\Formatter\FormatterInterface;
use Hyperf\Process\Event\AfterCoroutineHandle;
use Hyperf\Process\Event\AfterProcessHandle;
@ -21,7 +22,6 @@ use Hyperf\Process\Event\BeforeProcessHandle;
use Hyperf\Process\Event\PipeMessage;
use Hyperf\Process\Exception\ServerInvalidException;
use Hyperf\Process\Exception\SocketAcceptException;
use Hyperf\Server\CoroutineServer;
use Hyperf\Utils\Coordinator\Constants;
use Hyperf\Utils\Coordinator\CoordinatorManager;
use Hyperf\Utils\Coroutine;
@ -105,7 +105,7 @@ abstract class AbstractProcess implements ProcessInterface
public function bind($server): void
{
if (CoroutineServer::isCoroutineServer($server)) {
if (Constant::isCoroutineServer($server)) {
$this->bindCoroutineServer($server);
return;
}

View File

@ -108,6 +108,9 @@ class CoroutineServer implements ServerInterface
return $this->server;
}
/**
* @deprecated v2.2
*/
public static function isCoroutineServer($server): bool
{
return $server instanceof Coroutine\Http\Server || $server instanceof Coroutine\Server;