Merge pull request #637 from limingxinleo/1.1-ws

Optimized OnMessageInterface and OnOpenInterface.
This commit is contained in:
黄朝晖 2019-09-29 16:27:35 +08:00 committed by GitHub
commit 0fffcfa59f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 8 additions and 5 deletions

View File

@ -42,8 +42,6 @@ return ApplicationContext::setContainer($container);
- [#523](https://github.com/hyperf-cloud/hyperf/pull/523) The command `db:model` will generate the singular class name of an plural table as default.
- [#602](https://github.com/hyperf-cloud/hyperf/pull/602) Removed timeout property of `Hyperf\Utils\Coroutine\Concurrent`.
- [#614](https://github.com/hyperf-cloud/hyperf/pull/614) [#617](https://github.com/hyperf-cloud/hyperf/pull/617) Changed the structure of config provider, also moved `config/dependencies.php` to `config/autoload/dependencies.php`, also you could place `dependencies` into config/config.php.
- [#630](https://github.com/hyperf-cloud/hyperf/pull/630) Changed the way to instantiate `Hyperf\HttpServer\CoreMiddleware`, use `make()` instead of `new`
- [#631](https://github.com/hyperf-cloud/hyperf/pull/631) Changed the way to instantiate AMQP Consumer, use `make()` instead of `new`
Changed the structure of config provider:
Before:
@ -67,6 +65,11 @@ Now:
],
```
- [#630](https://github.com/hyperf-cloud/hyperf/pull/630) Changed the way to instantiate `Hyperf\HttpServer\CoreMiddleware`, use `make()` instead of `new`.
- [#631](https://github.com/hyperf-cloud/hyperf/pull/631) Changed the way to instantiate AMQP Consumer, use `make()` instead of `new`.
- [#637](https://github.com/hyperf-cloud/hyperf/pull/637) Changed the argument 1 of `Hyperf\Contract\OnMessageInterface` and `Hyperf\Contract\OnOpenInterface`, use `Swoole\WebSocket\Server` instead of `Swoole\Server`.
## Deleted
- [#401](https://github.com/hyperf-cloud/hyperf/pull/401) Deleted class `Hyperf\JsonRpc\HttpServerFactory`, `Hyperf\HttpServer\ServerFactory`, `Hyperf\GrpcServer\ServerFactory`.

View File

@ -12,8 +12,8 @@ declare(strict_types=1);
namespace Hyperf\Contract;
use Swoole\Server;
use Swoole\Websocket\Frame;
use Swoole\WebSocket\Server;
interface OnMessageInterface
{

View File

@ -13,7 +13,7 @@ declare(strict_types=1);
namespace Hyperf\Contract;
use Swoole\Http\Request;
use Swoole\Server;
use Swoole\WebSocket\Server;
interface OnOpenInterface
{

View File

@ -161,7 +161,7 @@ class Server implements MiddlewareInitializerInterface, OnHandShakeInterface, On
}
}
public function onMessage(SwooleServer $server, Frame $frame): void
public function onMessage(WebSocketServer $server, Frame $frame): void
{
$fdObj = FdCollector::get($frame->fd);
if (! $fdObj) {