Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimized OnMessageInterface and OnOpenInterface. #637

Merged
merged 4 commits into from Sep 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 5 additions & 2 deletions CHANGELOG.md
Expand Up @@ -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:
Expand All @@ -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`.
Expand Down
2 changes: 1 addition & 1 deletion src/contract/src/OnMessageInterface.php
Expand Up @@ -12,8 +12,8 @@

namespace Hyperf\Contract;

use Swoole\Server;
use Swoole\Websocket\Frame;
use Swoole\WebSocket\Server;

interface OnMessageInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/contract/src/OnOpenInterface.php
Expand Up @@ -13,7 +13,7 @@
namespace Hyperf\Contract;

use Swoole\Http\Request;
use Swoole\Server;
use Swoole\WebSocket\Server;

interface OnOpenInterface
{
Expand Down
2 changes: 1 addition & 1 deletion src/websocket-server/src/Server.php
Expand Up @@ -161,7 +161,7 @@ public function onHandShake(SwooleRequest $request, SwooleResponse $response): v
}
}

public function onMessage(SwooleServer $server, Frame $frame): void
public function onMessage(WebSocketServer $server, Frame $frame): void
{
$fdObj = FdCollector::get($frame->fd);
if (! $fdObj) {
Expand Down