mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-12-02 03:37:44 +08:00
Release v2.1.19 (#3637)
This commit is contained in:
parent
2c40ec01b7
commit
a0146e53d0
@ -1,4 +1,6 @@
|
||||
# v2.1.19 - TBD
|
||||
# v2.1.20 - TBD
|
||||
|
||||
# v2.1.19 - 2021-05-31
|
||||
|
||||
## Fixed
|
||||
|
||||
@ -9,6 +11,10 @@
|
||||
|
||||
- [#3626](https://github.com/hyperf/hyperf/pull/3626) Added `Hyperf\Rpc\PathGenerator\DotPathGenerator`.
|
||||
|
||||
## Incubator
|
||||
|
||||
- [nacos-sdk](https://github.com/hyperf/nacos-sdk-incubator) Nacos SDK for Open API.
|
||||
|
||||
# v2.1.18 - 2021-05-24
|
||||
|
||||
## Fixed
|
||||
|
@ -1,5 +1,20 @@
|
||||
# 版本更新记录
|
||||
|
||||
# v2.1.19 - 2021-05-31
|
||||
|
||||
## 修复
|
||||
|
||||
- [#3618](https://github.com/hyperf/hyperf/pull/3618) 修复使用了相同路径但不同实现逻辑的路由会在命令 `describe:routes` 中,被合并成一条的问题。
|
||||
- [#3625](https://github.com/hyperf/hyperf/pull/3625) 修复 `Hyperf\Di\Annotation\Scanner` 中无法正常使用 `class_map` 功能的问题。
|
||||
|
||||
## 新增
|
||||
|
||||
- [#3626](https://github.com/hyperf/hyperf/pull/3626) 为 `RPC` 组件增加了新的路径打包器 `Hyperf\Rpc\PathGenerator\DotPathGenerator`。
|
||||
|
||||
## 新组件孵化
|
||||
|
||||
- [nacos-sdk](https://github.com/hyperf/nacos-sdk-incubator) 基于 Nacos Open API 实现的 SDK。
|
||||
|
||||
# v2.1.18 - 2021-05-24
|
||||
|
||||
## 修复
|
||||
|
@ -225,3 +225,49 @@ class ServerController
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## 在 WebSocket 服务中处理 HTTP 请求
|
||||
|
||||
我们除了可以将 HTTP 服务和 WebSocket 服务通过端口分开,也可以在 WebSocket 中监听 HTTP 请求。
|
||||
|
||||
因为 `server.servers.*.callbacks` 中的配置项,都是单例的,所以我们需要在 `dependencies` 中配置一个单独的实例。
|
||||
|
||||
```php
|
||||
<?php
|
||||
return [
|
||||
'HttpServer' => Hyperf\HttpServer\Server::class,
|
||||
];
|
||||
```
|
||||
|
||||
然后修改我们的 `WebSocket` 服务中的 `callbacks` 配置,以下隐藏了不相干的配置
|
||||
|
||||
```php
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Hyperf\Server\Event;
|
||||
use Hyperf\Server\Server;
|
||||
|
||||
return [
|
||||
'mode' => SWOOLE_BASE,
|
||||
'servers' => [
|
||||
[
|
||||
'name' => 'ws',
|
||||
'type' => Server::SERVER_WEBSOCKET,
|
||||
'host' => '0.0.0.0',
|
||||
'port' => 9502,
|
||||
'sock_type' => SWOOLE_SOCK_TCP,
|
||||
'callbacks' => [
|
||||
Event::ON_REQUEST => ['HttpServer', 'onRequest'],
|
||||
Event::ON_HAND_SHAKE => [Hyperf\WebSocketServer\Server::class, 'onHandShake'],
|
||||
Event::ON_MESSAGE => [Hyperf\WebSocketServer\Server::class, 'onMessage'],
|
||||
Event::ON_CLOSE => [Hyperf\WebSocketServer\Server::class, 'onClose'],
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
```
|
||||
|
||||
最后我们便可以在 `ws` 中,添加 `HTTP` 路由了。
|
||||
|
@ -1,5 +1,20 @@
|
||||
# 版本更新記錄
|
||||
|
||||
# v2.1.19 - 2021-05-31
|
||||
|
||||
## 修復
|
||||
|
||||
- [#3618](https://github.com/hyperf/hyperf/pull/3618) 修復使用了相同路徑但不同實現邏輯的路由會在命令 `describe:routes` 中,被合併成一條的問題。
|
||||
- [#3625](https://github.com/hyperf/hyperf/pull/3625) 修復 `Hyperf\Di\Annotation\Scanner` 中無法正常使用 `class_map` 功能的問題。
|
||||
|
||||
## 新增
|
||||
|
||||
- [#3626](https://github.com/hyperf/hyperf/pull/3626) 為 `RPC` 組件增加了新的路徑打包器 `Hyperf\Rpc\PathGenerator\DotPathGenerator`。
|
||||
|
||||
## 新組件孵化
|
||||
|
||||
- [nacos-sdk](https://github.com/hyperf/nacos-sdk-incubator) 基於 Nacos Open API 實現的 SDK。
|
||||
|
||||
# v2.1.18 - 2021-05-24
|
||||
|
||||
## 修復
|
||||
|
@ -28,7 +28,8 @@ return [
|
||||
'connect_timeout' => 10.0,
|
||||
'wait_timeout' => 3.0,
|
||||
'heartbeat' => -1,
|
||||
'max_idle_time' => 60.0,
|
||||
// 因為 Nsq 服務默認的閒置時間是 60s,故框架維護的最大閒置時間應小於 60s
|
||||
'max_idle_time' => 30.0,
|
||||
],
|
||||
],
|
||||
];
|
||||
|
@ -225,3 +225,49 @@ class ServerController
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## 在 WebSocket 服務中處理 HTTP 請求
|
||||
|
||||
我們除了可以將 HTTP 服務和 WebSocket 服務通過端口分開,也可以在 WebSocket 中監聽 HTTP 請求。
|
||||
|
||||
因為 `server.servers.*.callbacks` 中的配置項,都是單例的,所以我們需要在 `dependencies` 中配置一個單獨的實例。
|
||||
|
||||
```php
|
||||
<?php
|
||||
return [
|
||||
'HttpServer' => Hyperf\HttpServer\Server::class,
|
||||
];
|
||||
```
|
||||
|
||||
然後修改我們的 `WebSocket` 服務中的 `callbacks` 配置,以下隱藏了不相干的配置
|
||||
|
||||
```php
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Hyperf\Server\Event;
|
||||
use Hyperf\Server\Server;
|
||||
|
||||
return [
|
||||
'mode' => SWOOLE_BASE,
|
||||
'servers' => [
|
||||
[
|
||||
'name' => 'ws',
|
||||
'type' => Server::SERVER_WEBSOCKET,
|
||||
'host' => '0.0.0.0',
|
||||
'port' => 9502,
|
||||
'sock_type' => SWOOLE_SOCK_TCP,
|
||||
'callbacks' => [
|
||||
Event::ON_REQUEST => ['HttpServer', 'onRequest'],
|
||||
Event::ON_HAND_SHAKE => [Hyperf\WebSocketServer\Server::class, 'onHandShake'],
|
||||
Event::ON_MESSAGE => [Hyperf\WebSocketServer\Server::class, 'onMessage'],
|
||||
Event::ON_CLOSE => [Hyperf\WebSocketServer\Server::class, 'onClose'],
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
```
|
||||
|
||||
最後我們便可以在 `ws` 中,添加 `HTTP` 路由了。
|
||||
|
@ -1,5 +1,20 @@
|
||||
# 版本更新記錄
|
||||
|
||||
# v2.1.19 - 2021-05-31
|
||||
|
||||
## 修復
|
||||
|
||||
- [#3618](https://github.com/hyperf/hyperf/pull/3618) 修復使用了相同路徑但不同實現邏輯的路由會在命令 `describe:routes` 中,被合併成一條的問題。
|
||||
- [#3625](https://github.com/hyperf/hyperf/pull/3625) 修復 `Hyperf\Di\Annotation\Scanner` 中無法正常使用 `class_map` 功能的問題。
|
||||
|
||||
## 新增
|
||||
|
||||
- [#3626](https://github.com/hyperf/hyperf/pull/3626) 為 `RPC` 元件增加了新的路徑打包器 `Hyperf\Rpc\PathGenerator\DotPathGenerator`。
|
||||
|
||||
## 新元件孵化
|
||||
|
||||
- [nacos-sdk](https://github.com/hyperf/nacos-sdk-incubator) 基於 Nacos Open API 實現的 SDK。
|
||||
|
||||
# v2.1.18 - 2021-05-24
|
||||
|
||||
## 修復
|
||||
|
@ -28,7 +28,8 @@ return [
|
||||
'connect_timeout' => 10.0,
|
||||
'wait_timeout' => 3.0,
|
||||
'heartbeat' => -1,
|
||||
'max_idle_time' => 60.0,
|
||||
// 因為 Nsq 服務預設的閒置時間是 60s,故框架維護的最大閒置時間應小於 60s
|
||||
'max_idle_time' => 30.0,
|
||||
],
|
||||
],
|
||||
];
|
||||
|
@ -225,3 +225,49 @@ class ServerController
|
||||
}
|
||||
|
||||
```
|
||||
|
||||
## 在 WebSocket 服務中處理 HTTP 請求
|
||||
|
||||
我們除了可以將 HTTP 服務和 WebSocket 服務通過埠分開,也可以在 WebSocket 中監聽 HTTP 請求。
|
||||
|
||||
因為 `server.servers.*.callbacks` 中的配置項,都是單例的,所以我們需要在 `dependencies` 中配置一個單獨的例項。
|
||||
|
||||
```php
|
||||
<?php
|
||||
return [
|
||||
'HttpServer' => Hyperf\HttpServer\Server::class,
|
||||
];
|
||||
```
|
||||
|
||||
然後修改我們的 `WebSocket` 服務中的 `callbacks` 配置,以下隱藏了不相干的配置
|
||||
|
||||
```php
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
use Hyperf\Server\Event;
|
||||
use Hyperf\Server\Server;
|
||||
|
||||
return [
|
||||
'mode' => SWOOLE_BASE,
|
||||
'servers' => [
|
||||
[
|
||||
'name' => 'ws',
|
||||
'type' => Server::SERVER_WEBSOCKET,
|
||||
'host' => '0.0.0.0',
|
||||
'port' => 9502,
|
||||
'sock_type' => SWOOLE_SOCK_TCP,
|
||||
'callbacks' => [
|
||||
Event::ON_REQUEST => ['HttpServer', 'onRequest'],
|
||||
Event::ON_HAND_SHAKE => [Hyperf\WebSocketServer\Server::class, 'onHandShake'],
|
||||
Event::ON_MESSAGE => [Hyperf\WebSocketServer\Server::class, 'onMessage'],
|
||||
Event::ON_CLOSE => [Hyperf\WebSocketServer\Server::class, 'onClose'],
|
||||
],
|
||||
],
|
||||
],
|
||||
];
|
||||
|
||||
```
|
||||
|
||||
最後我們便可以在 `ws` 中,新增 `HTTP` 路由了。
|
||||
|
Loading…
Reference in New Issue
Block a user