mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-12-02 03:37:44 +08:00
Merge pull request #637 from limingxinleo/1.1-ws
Optimized OnMessageInterface and OnOpenInterface.
This commit is contained in:
commit
0fffcfa59f
@ -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`.
|
||||
|
@ -12,8 +12,8 @@ declare(strict_types=1);
|
||||
|
||||
namespace Hyperf\Contract;
|
||||
|
||||
use Swoole\Server;
|
||||
use Swoole\Websocket\Frame;
|
||||
use Swoole\WebSocket\Server;
|
||||
|
||||
interface OnMessageInterface
|
||||
{
|
||||
|
@ -13,7 +13,7 @@ declare(strict_types=1);
|
||||
namespace Hyperf\Contract;
|
||||
|
||||
use Swoole\Http\Request;
|
||||
use Swoole\Server;
|
||||
use Swoole\WebSocket\Server;
|
||||
|
||||
interface OnOpenInterface
|
||||
{
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user