mirror of
https://gitee.com/hyperf/hyperf.git
synced 2024-12-04 20:58:13 +08:00
Merge branch 'master' into pr/1575
This commit is contained in:
commit
f5033e9cc8
1
.php_cs
1
.php_cs
@ -81,6 +81,7 @@ return PhpCsFixer\Config::create()
|
|||||||
])
|
])
|
||||||
->setFinder(
|
->setFinder(
|
||||||
PhpCsFixer\Finder::create()
|
PhpCsFixer\Finder::create()
|
||||||
|
->exclude('bin')
|
||||||
->exclude('public')
|
->exclude('public')
|
||||||
->exclude('runtime')
|
->exclude('runtime')
|
||||||
->exclude('vendor')
|
->exclude('vendor')
|
||||||
|
23
CHANGELOG.md
23
CHANGELOG.md
@ -1,8 +1,27 @@
|
|||||||
# v1.1.26 - TBD
|
# v1.1.27 - TBD
|
||||||
|
|
||||||
|
## Added
|
||||||
|
|
||||||
|
- [#1586](https://github.com/hyperf/hyperf/pull/1586) Added conflict of symfony/event-dispatcher which < 4.3.
|
||||||
|
|
||||||
|
# v1.1.26 - 2020-04-16
|
||||||
|
|
||||||
|
## Added
|
||||||
|
|
||||||
|
- [#1578](https://github.com/hyperf/hyperf/pull/1578) Support `getStream` method in `UploadedFile.php`.
|
||||||
|
|
||||||
## Fixed
|
## Fixed
|
||||||
|
|
||||||
- [#1563](https://github.com/hyperf/hyperf/pull/1563) Fixed crontab's `onOneServer` option not resetting mutex on shutdown
|
- [#1563](https://github.com/hyperf/hyperf/pull/1563) Fixed crontab's `onOneServer` option not resetting mutex on shutdown.
|
||||||
|
- [#1565](https://github.com/hyperf/hyperf/pull/1565) Reset transaction level to zero, when reconnent to mysql server.
|
||||||
|
- [#1572](https://github.com/hyperf/hyperf/pull/1572) Fixed parent class does not exists in `Hyperf\GrpcServer\CoreMiddleware`.
|
||||||
|
- [#1577](https://github.com/hyperf/hyperf/pull/1577) Fixed `describe:routes` command's `server` option not take effect.
|
||||||
|
- [#1579](https://github.com/hyperf/hyperf/pull/1579) Fixed `migrate:refresh` command's `step` is int.
|
||||||
|
|
||||||
|
## Changed
|
||||||
|
|
||||||
|
- [#1560](https://github.com/hyperf/hyperf/pull/1560) Changed functions of file to `filesystem` for `FileSystemDriver` in `hyperf/cache`.
|
||||||
|
- [#1568](https://github.com/hyperf/hyperf/pull/1568) Changed `\Redis` to `RedisProxy` for `RedisDriver` in `async-queue`.
|
||||||
|
|
||||||
# v1.1.25 - 2020-04-09
|
# v1.1.25 - 2020-04-09
|
||||||
|
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
! defined('BASE_PATH') && define('BASE_PATH', __DIR__);
|
! defined('BASE_PATH') && define('BASE_PATH', __DIR__);
|
||||||
! defined('SWOOLE_HOOK_FLAGS') && define('SWOOLE_HOOK_FLAGS', SWOOLE_HOOK_ALL);
|
! defined('SWOOLE_HOOK_FLAGS') && define('SWOOLE_HOOK_FLAGS', SWOOLE_HOOK_ALL);
|
||||||
|
|
||||||
|
@ -74,6 +74,7 @@
|
|||||||
"swoole/ide-helper": "dev-master",
|
"swoole/ide-helper": "dev-master",
|
||||||
"sy-records/think-template": "^2.0",
|
"sy-records/think-template": "^2.0",
|
||||||
"symfony/console": "^4.2",
|
"symfony/console": "^4.2",
|
||||||
|
"symfony/event-dispatcher": "^4.3",
|
||||||
"symfony/finder": "^4.1",
|
"symfony/finder": "^4.1",
|
||||||
"symfony/property-access": "^4.3",
|
"symfony/property-access": "^4.3",
|
||||||
"symfony/serializer": "^4.3",
|
"symfony/serializer": "^4.3",
|
||||||
@ -136,6 +137,9 @@
|
|||||||
"hyperf/websocket-server": "self.version"
|
"hyperf/websocket-server": "self.version"
|
||||||
},
|
},
|
||||||
"suggest": {},
|
"suggest": {},
|
||||||
|
"conflict": {
|
||||||
|
"symfony/event-dispatcher": "<4.3"
|
||||||
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"files": [
|
"files": [
|
||||||
"src/config/src/Functions.php",
|
"src/config/src/Functions.php",
|
||||||
|
@ -18,6 +18,7 @@ composer require hyperf/async-queue
|
|||||||
|:----------------:|:---------:|:-------------------------------------------:|:---------------------------------------:|
|
|:----------------:|:---------:|:-------------------------------------------:|:---------------------------------------:|
|
||||||
| driver | string | Hyperf\AsyncQueue\Driver\RedisDriver::class | 无 |
|
| driver | string | Hyperf\AsyncQueue\Driver\RedisDriver::class | 无 |
|
||||||
| channel | string | queue | 队列前缀 |
|
| channel | string | queue | 队列前缀 |
|
||||||
|
| redis.pool | string | default | redis连接池 |
|
||||||
| timeout | int | 2 | pop 消息的超时时间 |
|
| timeout | int | 2 | pop 消息的超时时间 |
|
||||||
| retry_seconds | int,array | 5 | 失败后重新尝试间隔 |
|
| retry_seconds | int,array | 5 | 失败后重新尝试间隔 |
|
||||||
| handle_timeout | int | 10 | 消息处理超时时间 |
|
| handle_timeout | int | 10 | 消息处理超时时间 |
|
||||||
@ -31,6 +32,9 @@ composer require hyperf/async-queue
|
|||||||
return [
|
return [
|
||||||
'default' => [
|
'default' => [
|
||||||
'driver' => Hyperf\AsyncQueue\Driver\RedisDriver::class,
|
'driver' => Hyperf\AsyncQueue\Driver\RedisDriver::class,
|
||||||
|
'redis' => [
|
||||||
|
'pool' => 'default'
|
||||||
|
],
|
||||||
'channel' => 'queue',
|
'channel' => 'queue',
|
||||||
'timeout' => 2,
|
'timeout' => 2,
|
||||||
'retry_seconds' => 5,
|
'retry_seconds' => 5,
|
||||||
|
@ -1,5 +1,24 @@
|
|||||||
# 版本更新记录
|
# 版本更新记录
|
||||||
|
|
||||||
|
# v1.1.26 - 2020-04-16
|
||||||
|
|
||||||
|
## Added
|
||||||
|
|
||||||
|
- [#1578](https://github.com/hyperf/hyperf/pull/1578) `UploadedFile` 支持 `getStream` 方法。
|
||||||
|
|
||||||
|
## Fixed
|
||||||
|
|
||||||
|
- [#1563](https://github.com/hyperf/hyperf/pull/1563) 修复服务关停后,定时器的 `onOneServer` 配置不会被重置。
|
||||||
|
- [#1565](https://github.com/hyperf/hyperf/pull/1565) 当 `DB` 组件重连 `Mysql` 时,重置事务等级为 0。
|
||||||
|
- [#1572](https://github.com/hyperf/hyperf/pull/1572) 修复 `Hyperf\GrpcServer\CoreMiddleware` 中,自定义类的父类找不到时报错的BUG。
|
||||||
|
- [#1577](https://github.com/hyperf/hyperf/pull/1577) 修复 `describe:routes` 脚本 `server` 配置不生效的BUG。
|
||||||
|
- [#1579](https://github.com/hyperf/hyperf/pull/1579) 修复 `migrate:refresh` 脚本 `step` 参数不为 `int` 时会报错的BUG。
|
||||||
|
|
||||||
|
## Changed
|
||||||
|
|
||||||
|
- [#1560](https://github.com/hyperf/hyperf/pull/1560) 修改 `hyperf/cache` 组件文件缓存引擎中 原生的文件操作为 `Filesystem`。
|
||||||
|
- [#1568](https://github.com/hyperf/hyperf/pull/1568) 修改 `hyperf/async-queue` 组件 `Redis` 引擎中的 `\Redis` 为 `RedisProxy`。
|
||||||
|
|
||||||
# v1.1.25 - 2020-04-09
|
# v1.1.25 - 2020-04-09
|
||||||
|
|
||||||
## Fixed
|
## Fixed
|
||||||
|
@ -39,14 +39,23 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace App\Controller;
|
namespace App\Controller;
|
||||||
|
|
||||||
class IndexController
|
class IndexController extends AbstractController
|
||||||
{
|
{
|
||||||
public function example(\League\Flysystem\Filesystem $filesystem)
|
public function example(\League\Flysystem\Filesystem $filesystem)
|
||||||
{
|
{
|
||||||
|
// Process Upload
|
||||||
|
$file = $this->request->file('upload');
|
||||||
|
$stream = fopen($file->getRealPath(), 'r+');
|
||||||
|
$filesystem->writeStream(
|
||||||
|
'uploads/'.$file->getClientFilename(),
|
||||||
|
$stream
|
||||||
|
);
|
||||||
|
fclose($stream);
|
||||||
|
|
||||||
// Write Files
|
// Write Files
|
||||||
$filesystem->write('path/to/file.txt', 'contents');
|
$filesystem->write('path/to/file.txt', 'contents');
|
||||||
|
|
||||||
// Write Use writeStream
|
// Add local file
|
||||||
$stream = fopen('local/path/to/file.txt', 'r+');
|
$stream = fopen('local/path/to/file.txt', 'r+');
|
||||||
$result = $filesystem->writeStream('path/to/file.txt', $stream);
|
$result = $filesystem->writeStream('path/to/file.txt', $stream);
|
||||||
if (is_resource($stream)) {
|
if (is_resource($stream)) {
|
||||||
@ -122,7 +131,8 @@ return [
|
|||||||
|
|
||||||
1. S3 存储请确认安装 `hyperf/guzzle` 组件以提供协程化支持。阿里云、七牛云存储请[开启 Curl Hook](/zh-cn/coroutine?id=swoole-runtime-hook-level)来使用协程。因 Curl Hook 的参数支持性问题,请使用 Swoole 4.4.13 以上版本。
|
1. S3 存储请确认安装 `hyperf/guzzle` 组件以提供协程化支持。阿里云、七牛云存储请[开启 Curl Hook](/zh-cn/coroutine?id=swoole-runtime-hook-level)来使用协程。因 Curl Hook 的参数支持性问题,请使用 Swoole 4.4.13 以上版本。
|
||||||
2. minIO, ceph radosgw 等私有对象存储方案均支持 S3 协议,可以使用 S3 适配器。
|
2. minIO, ceph radosgw 等私有对象存储方案均支持 S3 协议,可以使用 S3 适配器。
|
||||||
3. 以阿里云 OSS 为例,1 核 1 进程读操作性能对比:
|
3. 使用Local驱动时,根目录是配置好的地址,而不是操作系统的根目录。例如,Local驱动 `root` 设置为 `/var/www`, 则本地磁盘上的 `/var/www/public/file.txt` 通过 flysystem API 访问时应使用 `/public/file.txt` 或 `public/file.txt` 。
|
||||||
|
4. 以阿里云 OSS 为例,1 核 1 进程读操作性能对比:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
ab -k -c 10 -n 1000 http://127.0.0.1:9501/
|
ab -k -c 10 -n 1000 http://127.0.0.1:9501/
|
||||||
|
@ -62,30 +62,6 @@ vendor/bin/init-proxy.sh && composer test
|
|||||||
vendor/bin/init-proxy.sh && php bin/hyperf.php start
|
vendor/bin/init-proxy.sh && php bin/hyperf.php start
|
||||||
```
|
```
|
||||||
|
|
||||||
## PHP7.3 下预先生成代理的脚本 执行失败
|
|
||||||
|
|
||||||
`php bin/hyperf.php di:init-proxy` 脚本在 `PHP7.3` 的 `Docker` 打包时,会因为返回码是 `1` 而失败。
|
|
||||||
|
|
||||||
> 具体原因还在定位中
|
|
||||||
|
|
||||||
以下通过重写 `init-proxy.sh` 脚本绕过这个问题。
|
|
||||||
|
|
||||||
```bash
|
|
||||||
#!/usr/bin/env bash
|
|
||||||
|
|
||||||
php /opt/www/bin/hyperf.php di:init-proxy
|
|
||||||
|
|
||||||
echo Started.
|
|
||||||
```
|
|
||||||
|
|
||||||
对应的 `Dockerfile` 修改以下代码,省略无用的代码展示。
|
|
||||||
|
|
||||||
```dockerfile
|
|
||||||
RUN composer install --no-dev \
|
|
||||||
&& composer dump-autoload -o \
|
|
||||||
&& ./init-proxy.sh
|
|
||||||
```
|
|
||||||
|
|
||||||
## 异步队列消息丢失
|
## 异步队列消息丢失
|
||||||
|
|
||||||
如果在使用 `async-queue` 组件时,发现 `handle` 中的方法没有执行,请先检查以下几种情况:
|
如果在使用 `async-queue` 组件时,发现 `handle` 中的方法没有执行,请先检查以下几种情况:
|
||||||
@ -97,3 +73,27 @@ RUN composer install --no-dev \
|
|||||||
|
|
||||||
1. killall php
|
1. killall php
|
||||||
2. 修改 `async-queue` 配置 `channel`
|
2. 修改 `async-queue` 配置 `channel`
|
||||||
|
|
||||||
|
## 1.1.24 - 1.1.26 版本 SymfonyEventDispatcher 报错
|
||||||
|
|
||||||
|
因为 `symfony/console` 默认使用的 `^4.2` 版本,而 `symfony/event-dispatcher` 的 `^4.3` 版本与 `<4.3` 版本不兼容。
|
||||||
|
|
||||||
|
`hyperf/framework` 默认推荐使用 `^4.3` 版本的 `symfony/event-dispatcher`,就有一定概率导致实现上的冲突。
|
||||||
|
|
||||||
|
如果有类似的情况出现,可以尝试以下操作
|
||||||
|
|
||||||
|
```
|
||||||
|
rm -rf vendor
|
||||||
|
rm -rf composer.lock
|
||||||
|
composer require "symfony/event-dispatcher:^4.3"
|
||||||
|
```
|
||||||
|
|
||||||
|
1.1.27 版本中,会在 `composer.json` 中添加以下配置,来处理这个问题。
|
||||||
|
|
||||||
|
```
|
||||||
|
"conflict": {
|
||||||
|
"symfony/event-dispatcher": "<4.3"
|
||||||
|
},
|
||||||
|
```
|
||||||
|
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@ composer require hyperf/async-queue
|
|||||||
|:----------------:|:---------:|:-------------------------------------------:|:---------------------------------------:|
|
|:----------------:|:---------:|:-------------------------------------------:|:---------------------------------------:|
|
||||||
| driver | string | Hyperf\AsyncQueue\Driver\RedisDriver::class | 無 |
|
| driver | string | Hyperf\AsyncQueue\Driver\RedisDriver::class | 無 |
|
||||||
| channel | string | queue | 隊列前綴 |
|
| channel | string | queue | 隊列前綴 |
|
||||||
|
| redis.pool | string | default | redis連接池 |
|
||||||
| timeout | int | 2 | pop 消息的超時時間 |
|
| timeout | int | 2 | pop 消息的超時時間 |
|
||||||
| retry_seconds | int,array | 5 | 失敗後重新嘗試間隔 |
|
| retry_seconds | int,array | 5 | 失敗後重新嘗試間隔 |
|
||||||
| handle_timeout | int | 10 | 消息處理超時時間 |
|
| handle_timeout | int | 10 | 消息處理超時時間 |
|
||||||
@ -31,6 +32,9 @@ composer require hyperf/async-queue
|
|||||||
return [
|
return [
|
||||||
'default' => [
|
'default' => [
|
||||||
'driver' => Hyperf\AsyncQueue\Driver\RedisDriver::class,
|
'driver' => Hyperf\AsyncQueue\Driver\RedisDriver::class,
|
||||||
|
'redis' => [
|
||||||
|
'pool' => 'default'
|
||||||
|
],
|
||||||
'channel' => 'queue',
|
'channel' => 'queue',
|
||||||
'timeout' => 2,
|
'timeout' => 2,
|
||||||
'retry_seconds' => 5,
|
'retry_seconds' => 5,
|
||||||
|
@ -1,5 +1,24 @@
|
|||||||
# 版本更新記錄
|
# 版本更新記錄
|
||||||
|
|
||||||
|
# v1.1.26 - 2020-04-16
|
||||||
|
|
||||||
|
## Added
|
||||||
|
|
||||||
|
- [#1578](https://github.com/hyperf/hyperf/pull/1578) `UploadedFile` 支持 `getStream` 方法。
|
||||||
|
|
||||||
|
## Fixed
|
||||||
|
|
||||||
|
- [#1563](https://github.com/hyperf/hyperf/pull/1563) 修復服務關停後,定時器的 `onOneServer` 配置不會被重置。
|
||||||
|
- [#1565](https://github.com/hyperf/hyperf/pull/1565) 當 `DB` 組件重連 `Mysql` 時,重置事務等級為 0。
|
||||||
|
- [#1572](https://github.com/hyperf/hyperf/pull/1572) 修復 `Hyperf\GrpcServer\CoreMiddleware` 中,自定義類的父類找不到時報錯的BUG。
|
||||||
|
- [#1577](https://github.com/hyperf/hyperf/pull/1577) 修復 `describe:routes` 腳本 `server` 配置不生效的BUG。
|
||||||
|
- [#1579](https://github.com/hyperf/hyperf/pull/1579) 修復 `migrate:refresh` 腳本 `step` 參數不為 `int` 時會報錯的BUG。
|
||||||
|
|
||||||
|
## Changed
|
||||||
|
|
||||||
|
- [#1560](https://github.com/hyperf/hyperf/pull/1560) 修改 `hyperf/cache` 組件文件緩存引擎中 原生的文件操作為 `Filesystem`。
|
||||||
|
- [#1568](https://github.com/hyperf/hyperf/pull/1568) 修改 `hyperf/async-queue` 組件 `Redis` 引擎中的 `\Redis` 為 `RedisProxy`。
|
||||||
|
|
||||||
# v1.1.25 - 2020-04-09
|
# v1.1.25 - 2020-04-09
|
||||||
|
|
||||||
## Fixed
|
## Fixed
|
||||||
|
@ -101,6 +101,23 @@ class IndexController
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### 配置靜態資源
|
||||||
|
|
||||||
|
如果您希望通過 http 訪問上傳到本地的文件,請在 `config/autoload/server.php` 配置中增加以下配置。
|
||||||
|
|
||||||
|
```
|
||||||
|
return [
|
||||||
|
'settings' => [
|
||||||
|
...
|
||||||
|
// 將 public 替換為上傳目錄
|
||||||
|
'document_root' => BASE_PATH . '/public',
|
||||||
|
'static_handler_locations' => ['/'],
|
||||||
|
'enable_static_handler' => true,
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
## 注意事項
|
## 注意事項
|
||||||
|
|
||||||
1. S3 存儲請確認安裝 `hyperf/guzzle` 組件以提供協程化支持。阿里雲、七牛雲存儲請[開啟 Curl Hook](/zh-cn/coroutine?id=swoole-runtime-hook-level)來使用協程。因 Curl Hook 的參數支持性問題,請使用 Swoole 4.4.13 以上版本。
|
1. S3 存儲請確認安裝 `hyperf/guzzle` 組件以提供協程化支持。阿里雲、七牛雲存儲請[開啟 Curl Hook](/zh-cn/coroutine?id=swoole-runtime-hook-level)來使用協程。因 Curl Hook 的參數支持性問題,請使用 Swoole 4.4.13 以上版本。
|
||||||
@ -217,4 +234,4 @@ return [
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
```
|
```
|
||||||
|
@ -23,3 +23,25 @@ Hyperf 提供了大量便捷的輔助類,這裏會列出一些常用的好用
|
|||||||
### Hyperf\Utils\Context
|
### Hyperf\Utils\Context
|
||||||
|
|
||||||
用於處理協程上下文,本質上是對 `Swoole\Coroutine::getContext()` 方法的一個封裝,但區別在於這裏兼容了非協程環境下的運行。
|
用於處理協程上下文,本質上是對 `Swoole\Coroutine::getContext()` 方法的一個封裝,但區別在於這裏兼容了非協程環境下的運行。
|
||||||
|
|
||||||
|
### Hyperf\Utils\Coordinator\CoordinatorManager
|
||||||
|
|
||||||
|
該輔助類用於指揮協程等待事件發生。
|
||||||
|
|
||||||
|
```php
|
||||||
|
<?php
|
||||||
|
use Hyperf\Utils\Coordinator\CoordinatorManager;
|
||||||
|
use Hyperf\Utils\Coordinator\Constants;
|
||||||
|
use Hyperf\Utils\Coroutine;
|
||||||
|
|
||||||
|
Coroutine::create(function() {
|
||||||
|
// 所有OnWorkerStart事件回調完成後喚醒
|
||||||
|
CoordinatorManager::until(Constants::WORKER_START)->yield();
|
||||||
|
echo 'worker started';
|
||||||
|
// 分配資源
|
||||||
|
// 所有OnWorkerExit事件回調完成後喚醒
|
||||||
|
CoordinatorManager::until(Constants::WORKER_EXIT)->yield();
|
||||||
|
echo 'worker exited';
|
||||||
|
// 回收資源
|
||||||
|
});
|
||||||
|
```
|
||||||
|
@ -18,6 +18,7 @@ composer require hyperf/async-queue
|
|||||||
|:----------------:|:---------:|:-------------------------------------------:|:---------------------------------------:|
|
|:----------------:|:---------:|:-------------------------------------------:|:---------------------------------------:|
|
||||||
| driver | string | Hyperf\AsyncQueue\Driver\RedisDriver::class | 無 |
|
| driver | string | Hyperf\AsyncQueue\Driver\RedisDriver::class | 無 |
|
||||||
| channel | string | queue | 佇列字首 |
|
| channel | string | queue | 佇列字首 |
|
||||||
|
| redis.pool | string | default | redis連線池 |
|
||||||
| timeout | int | 2 | pop 訊息的超時時間 |
|
| timeout | int | 2 | pop 訊息的超時時間 |
|
||||||
| retry_seconds | int,array | 5 | 失敗後重新嘗試間隔 |
|
| retry_seconds | int,array | 5 | 失敗後重新嘗試間隔 |
|
||||||
| handle_timeout | int | 10 | 訊息處理超時時間 |
|
| handle_timeout | int | 10 | 訊息處理超時時間 |
|
||||||
@ -31,6 +32,9 @@ composer require hyperf/async-queue
|
|||||||
return [
|
return [
|
||||||
'default' => [
|
'default' => [
|
||||||
'driver' => Hyperf\AsyncQueue\Driver\RedisDriver::class,
|
'driver' => Hyperf\AsyncQueue\Driver\RedisDriver::class,
|
||||||
|
'redis' => [
|
||||||
|
'pool' => 'default'
|
||||||
|
],
|
||||||
'channel' => 'queue',
|
'channel' => 'queue',
|
||||||
'timeout' => 2,
|
'timeout' => 2,
|
||||||
'retry_seconds' => 5,
|
'retry_seconds' => 5,
|
||||||
|
@ -1,5 +1,24 @@
|
|||||||
# 版本更新記錄
|
# 版本更新記錄
|
||||||
|
|
||||||
|
# v1.1.26 - 2020-04-16
|
||||||
|
|
||||||
|
## Added
|
||||||
|
|
||||||
|
- [#1578](https://github.com/hyperf/hyperf/pull/1578) `UploadedFile` 支援 `getStream` 方法。
|
||||||
|
|
||||||
|
## Fixed
|
||||||
|
|
||||||
|
- [#1563](https://github.com/hyperf/hyperf/pull/1563) 修復服務關停後,定時器的 `onOneServer` 配置不會被重置。
|
||||||
|
- [#1565](https://github.com/hyperf/hyperf/pull/1565) 當 `DB` 元件重連 `Mysql` 時,重置事務等級為 0。
|
||||||
|
- [#1572](https://github.com/hyperf/hyperf/pull/1572) 修復 `Hyperf\GrpcServer\CoreMiddleware` 中,自定義類的父類找不到時報錯的BUG。
|
||||||
|
- [#1577](https://github.com/hyperf/hyperf/pull/1577) 修復 `describe:routes` 指令碼 `server` 配置不生效的BUG。
|
||||||
|
- [#1579](https://github.com/hyperf/hyperf/pull/1579) 修復 `migrate:refresh` 指令碼 `step` 引數不為 `int` 時會報錯的BUG。
|
||||||
|
|
||||||
|
## Changed
|
||||||
|
|
||||||
|
- [#1560](https://github.com/hyperf/hyperf/pull/1560) 修改 `hyperf/cache` 元件檔案快取引擎中 原生的檔案操作為 `Filesystem`。
|
||||||
|
- [#1568](https://github.com/hyperf/hyperf/pull/1568) 修改 `hyperf/async-queue` 元件 `Redis` 引擎中的 `\Redis` 為 `RedisProxy`。
|
||||||
|
|
||||||
# v1.1.25 - 2020-04-09
|
# v1.1.25 - 2020-04-09
|
||||||
|
|
||||||
## Fixed
|
## Fixed
|
||||||
|
@ -101,6 +101,23 @@ class IndexController
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
### 配置靜態資源
|
||||||
|
|
||||||
|
如果您希望通過 http 訪問上傳到本地的檔案,請在 `config/autoload/server.php` 配置中增加以下配置。
|
||||||
|
|
||||||
|
```
|
||||||
|
return [
|
||||||
|
'settings' => [
|
||||||
|
...
|
||||||
|
// 將 public 替換為上傳目錄
|
||||||
|
'document_root' => BASE_PATH . '/public',
|
||||||
|
'static_handler_locations' => ['/'],
|
||||||
|
'enable_static_handler' => true,
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
## 注意事項
|
## 注意事項
|
||||||
|
|
||||||
1. S3 儲存請確認安裝 `hyperf/guzzle` 元件以提供協程化支援。阿里雲、七牛雲端儲存請[開啟 Curl Hook](/zh-cn/coroutine?id=swoole-runtime-hook-level)來使用協程。因 Curl Hook 的引數支援性問題,請使用 Swoole 4.4.13 以上版本。
|
1. S3 儲存請確認安裝 `hyperf/guzzle` 元件以提供協程化支援。阿里雲、七牛雲端儲存請[開啟 Curl Hook](/zh-cn/coroutine?id=swoole-runtime-hook-level)來使用協程。因 Curl Hook 的引數支援性問題,請使用 Swoole 4.4.13 以上版本。
|
||||||
@ -217,4 +234,4 @@ return [
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
```
|
```
|
||||||
|
@ -23,3 +23,25 @@ Hyperf 提供了大量便捷的輔助類,這裡會列出一些常用的好用
|
|||||||
### Hyperf\Utils\Context
|
### Hyperf\Utils\Context
|
||||||
|
|
||||||
用於處理協程上下文,本質上是對 `Swoole\Coroutine::getContext()` 方法的一個封裝,但區別在於這裡相容了非協程環境下的執行。
|
用於處理協程上下文,本質上是對 `Swoole\Coroutine::getContext()` 方法的一個封裝,但區別在於這裡相容了非協程環境下的執行。
|
||||||
|
|
||||||
|
### Hyperf\Utils\Coordinator\CoordinatorManager
|
||||||
|
|
||||||
|
該輔助類用於指揮協程等待事件發生。
|
||||||
|
|
||||||
|
```php
|
||||||
|
<?php
|
||||||
|
use Hyperf\Utils\Coordinator\CoordinatorManager;
|
||||||
|
use Hyperf\Utils\Coordinator\Constants;
|
||||||
|
use Hyperf\Utils\Coroutine;
|
||||||
|
|
||||||
|
Coroutine::create(function() {
|
||||||
|
// 所有OnWorkerStart事件回撥完成後喚醒
|
||||||
|
CoordinatorManager::until(Constants::WORKER_START)->yield();
|
||||||
|
echo 'worker started';
|
||||||
|
// 分配資源
|
||||||
|
// 所有OnWorkerExit事件回撥完成後喚醒
|
||||||
|
CoordinatorManager::until(Constants::WORKER_EXIT)->yield();
|
||||||
|
echo 'worker exited';
|
||||||
|
// 回收資源
|
||||||
|
});
|
||||||
|
```
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'default' => [
|
'default' => [
|
||||||
'host' => env('AMQP_HOST', 'localhost'),
|
'host' => env('AMQP_HOST', 'localhost'),
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\Amqp\Annotation;
|
namespace Hyperf\Amqp\Annotation;
|
||||||
|
|
||||||
use Hyperf\Di\Annotation\AbstractAnnotation;
|
use Hyperf\Di\Annotation\AbstractAnnotation;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\Amqp\Annotation;
|
namespace Hyperf\Amqp\Annotation;
|
||||||
|
|
||||||
use Hyperf\Di\Annotation\AbstractAnnotation;
|
use Hyperf\Di\Annotation\AbstractAnnotation;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\Amqp;
|
namespace Hyperf\Amqp;
|
||||||
|
|
||||||
use Hyperf\Amqp\Message\MessageInterface;
|
use Hyperf\Amqp\Message\MessageInterface;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\Amqp\Builder;
|
namespace Hyperf\Amqp\Builder;
|
||||||
|
|
||||||
use PhpAmqpLib\Wire\AMQPTable;
|
use PhpAmqpLib\Wire\AMQPTable;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\Amqp\Builder;
|
namespace Hyperf\Amqp\Builder;
|
||||||
|
|
||||||
class ExchangeBuilder extends Builder
|
class ExchangeBuilder extends Builder
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\Amqp\Builder;
|
namespace Hyperf\Amqp\Builder;
|
||||||
|
|
||||||
class QueueBuilder extends Builder
|
class QueueBuilder extends Builder
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\Amqp;
|
namespace Hyperf\Amqp;
|
||||||
|
|
||||||
use Hyperf\Amqp\Listener\BeforeMainServerStartListener;
|
use Hyperf\Amqp\Listener\BeforeMainServerStartListener;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\Amqp;
|
namespace Hyperf\Amqp;
|
||||||
|
|
||||||
use Hyperf\Amqp\Connection\AMQPSwooleConnection;
|
use Hyperf\Amqp\Connection\AMQPSwooleConnection;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\Amqp\Connection;
|
namespace Hyperf\Amqp\Connection;
|
||||||
|
|
||||||
use PhpAmqpLib\Connection\AbstractConnection;
|
use PhpAmqpLib\Connection\AbstractConnection;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\Amqp\Connection;
|
namespace Hyperf\Amqp\Connection;
|
||||||
|
|
||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\Amqp\Connection;
|
namespace Hyperf\Amqp\Connection;
|
||||||
|
|
||||||
use Hyperf\Contract\StdoutLoggerInterface;
|
use Hyperf\Contract\StdoutLoggerInterface;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\Amqp\Connection;
|
namespace Hyperf\Amqp\Connection;
|
||||||
|
|
||||||
use InvalidArgumentException;
|
use InvalidArgumentException;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\Amqp;
|
namespace Hyperf\Amqp;
|
||||||
|
|
||||||
class Constants
|
class Constants
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\Amqp;
|
namespace Hyperf\Amqp;
|
||||||
|
|
||||||
use Hyperf\Amqp\Event\AfterConsume;
|
use Hyperf\Amqp\Event\AfterConsume;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\Amqp;
|
namespace Hyperf\Amqp;
|
||||||
|
|
||||||
use Hyperf\Amqp\Pool\PoolFactory;
|
use Hyperf\Amqp\Pool\PoolFactory;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\Amqp;
|
namespace Hyperf\Amqp;
|
||||||
|
|
||||||
use Hyperf\Amqp\Annotation\Consumer as ConsumerAnnotation;
|
use Hyperf\Amqp\Annotation\Consumer as ConsumerAnnotation;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\Amqp;
|
namespace Hyperf\Amqp;
|
||||||
|
|
||||||
use Hyperf\Contract\ConnectionInterface;
|
use Hyperf\Contract\ConnectionInterface;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\Amqp\Event;
|
namespace Hyperf\Amqp\Event;
|
||||||
|
|
||||||
use Hyperf\Amqp\Message\ConsumerMessageInterface;
|
use Hyperf\Amqp\Message\ConsumerMessageInterface;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\Amqp\Event;
|
namespace Hyperf\Amqp\Event;
|
||||||
|
|
||||||
class BeforeConsume extends ConsumeEvent
|
class BeforeConsume extends ConsumeEvent
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\Amqp\Event;
|
namespace Hyperf\Amqp\Event;
|
||||||
|
|
||||||
use Hyperf\Amqp\Message\ConsumerMessageInterface;
|
use Hyperf\Amqp\Message\ConsumerMessageInterface;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\Amqp\Event;
|
namespace Hyperf\Amqp\Event;
|
||||||
|
|
||||||
use Hyperf\Amqp\Message\ConsumerMessageInterface;
|
use Hyperf\Amqp\Message\ConsumerMessageInterface;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\Amqp\Exception;
|
namespace Hyperf\Amqp\Exception;
|
||||||
|
|
||||||
use Exception;
|
use Exception;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\Amqp\Listener;
|
namespace Hyperf\Amqp\Listener;
|
||||||
|
|
||||||
use Hyperf\Amqp\ConsumerManager;
|
use Hyperf\Amqp\ConsumerManager;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\Amqp\Listener;
|
namespace Hyperf\Amqp\Listener;
|
||||||
|
|
||||||
use Doctrine\Instantiator\Instantiator;
|
use Doctrine\Instantiator\Instantiator;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\Amqp\Message;
|
namespace Hyperf\Amqp\Message;
|
||||||
|
|
||||||
use Hyperf\Amqp\Builder\QueueBuilder;
|
use Hyperf\Amqp\Builder\QueueBuilder;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\Amqp\Message;
|
namespace Hyperf\Amqp\Message;
|
||||||
|
|
||||||
use Hyperf\Amqp\Builder\QueueBuilder;
|
use Hyperf\Amqp\Builder\QueueBuilder;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\Amqp\Message;
|
namespace Hyperf\Amqp\Message;
|
||||||
|
|
||||||
use Hyperf\Amqp\Builder\ExchangeBuilder;
|
use Hyperf\Amqp\Builder\ExchangeBuilder;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\Amqp\Message;
|
namespace Hyperf\Amqp\Message;
|
||||||
|
|
||||||
use Hyperf\Amqp\Builder\ExchangeBuilder;
|
use Hyperf\Amqp\Builder\ExchangeBuilder;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\Amqp\Message;
|
namespace Hyperf\Amqp\Message;
|
||||||
|
|
||||||
use Hyperf\Amqp\Constants;
|
use Hyperf\Amqp\Constants;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\Amqp\Message;
|
namespace Hyperf\Amqp\Message;
|
||||||
|
|
||||||
interface ProducerMessageInterface extends MessageInterface
|
interface ProducerMessageInterface extends MessageInterface
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\Amqp\Message;
|
namespace Hyperf\Amqp\Message;
|
||||||
|
|
||||||
class Type
|
class Type
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\Amqp\Packer;
|
namespace Hyperf\Amqp\Packer;
|
||||||
|
|
||||||
use Hyperf\Contract\PackerInterface;
|
use Hyperf\Contract\PackerInterface;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\Amqp;
|
namespace Hyperf\Amqp;
|
||||||
|
|
||||||
class Params
|
class Params
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\Amqp\Pool;
|
namespace Hyperf\Amqp\Pool;
|
||||||
|
|
||||||
use Hyperf\Amqp\Connection;
|
use Hyperf\Amqp\Connection;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\Amqp\Pool;
|
namespace Hyperf\Amqp\Pool;
|
||||||
|
|
||||||
use Hyperf\Pool\Frequency as DefaultFrequency;
|
use Hyperf\Pool\Frequency as DefaultFrequency;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\Amqp\Pool;
|
namespace Hyperf\Amqp\Pool;
|
||||||
|
|
||||||
use Hyperf\Di\Container;
|
use Hyperf\Di\Container;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\Amqp;
|
namespace Hyperf\Amqp;
|
||||||
|
|
||||||
use Hyperf\Amqp\Message\ProducerMessageInterface;
|
use Hyperf\Amqp\Message\ProducerMessageInterface;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\Amqp;
|
namespace Hyperf\Amqp;
|
||||||
|
|
||||||
class Result
|
class Result
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace HyperfTest\Amqp;
|
namespace HyperfTest\Amqp;
|
||||||
|
|
||||||
use Hyperf\Amqp\Annotation\Consumer;
|
use Hyperf\Amqp\Annotation\Consumer;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace HyperfTest\Amqp;
|
namespace HyperfTest\Amqp;
|
||||||
|
|
||||||
use Hyperf\Amqp\Connection\KeepaliveIO;
|
use Hyperf\Amqp\Connection\KeepaliveIO;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace HyperfTest\Amqp\Message;
|
namespace HyperfTest\Amqp\Message;
|
||||||
|
|
||||||
use Hyperf\Amqp\Consumer;
|
use Hyperf\Amqp\Consumer;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace HyperfTest\Amqp\Message;
|
namespace HyperfTest\Amqp\Message;
|
||||||
|
|
||||||
use HyperfTest\Amqp\Stub\DemoConsumer;
|
use HyperfTest\Amqp\Stub\DemoConsumer;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace HyperfTest\Amqp;
|
namespace HyperfTest\Amqp;
|
||||||
|
|
||||||
use Hyperf\Amqp\Params;
|
use Hyperf\Amqp\Params;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace HyperfTest\Amqp\Stub;
|
namespace HyperfTest\Amqp\Stub;
|
||||||
|
|
||||||
use Hyperf\Amqp\Consumer;
|
use Hyperf\Amqp\Consumer;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace HyperfTest\Amqp\Stub;
|
namespace HyperfTest\Amqp\Stub;
|
||||||
|
|
||||||
use Hyperf\Amqp\Message\ConsumerMessage;
|
use Hyperf\Amqp\Message\ConsumerMessage;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace HyperfTest\Amqp\Stub;
|
namespace HyperfTest\Amqp\Stub;
|
||||||
|
|
||||||
use Hyperf\Amqp\Message\ProducerMessage;
|
use Hyperf\Amqp\Message\ProducerMessage;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace HyperfTest\Amqp\Stub;
|
namespace HyperfTest\Amqp\Stub;
|
||||||
|
|
||||||
use Hyperf\Amqp\Message\ConsumerMessage;
|
use Hyperf\Amqp\Message\ConsumerMessage;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace HyperfTest\Amqp\Stub;
|
namespace HyperfTest\Amqp\Stub;
|
||||||
|
|
||||||
use Hyperf\Amqp\Connection\Socket;
|
use Hyperf\Amqp\Connection\Socket;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace HyperfTest\Amqp\Stub;
|
namespace HyperfTest\Amqp\Stub;
|
||||||
|
|
||||||
use Hyperf\Amqp\Connection\Socket;
|
use Hyperf\Amqp\Connection\Socket;
|
||||||
|
@ -9,10 +9,12 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'default' => [
|
'default' => [
|
||||||
'driver' => \Hyperf\AsyncQueue\Driver\RedisDriver::class,
|
'driver' => \Hyperf\AsyncQueue\Driver\RedisDriver::class,
|
||||||
|
'redis' => [
|
||||||
|
'pool' => 'default',
|
||||||
|
],
|
||||||
'channel' => 'queue',
|
'channel' => 'queue',
|
||||||
'timeout' => 2,
|
'timeout' => 2,
|
||||||
'retry_seconds' => 5,
|
'retry_seconds' => 5,
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\AsyncQueue\Annotation;
|
namespace Hyperf\AsyncQueue\Annotation;
|
||||||
|
|
||||||
use Hyperf\Di\Annotation\AbstractAnnotation;
|
use Hyperf\Di\Annotation\AbstractAnnotation;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\AsyncQueue;
|
namespace Hyperf\AsyncQueue;
|
||||||
|
|
||||||
use Hyperf\Contract\CompressInterface;
|
use Hyperf\Contract\CompressInterface;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\AsyncQueue\Aspect;
|
namespace Hyperf\AsyncQueue\Aspect;
|
||||||
|
|
||||||
use Hyperf\AsyncQueue\Annotation\AsyncQueueMessage;
|
use Hyperf\AsyncQueue\Annotation\AsyncQueueMessage;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\AsyncQueue\Command;
|
namespace Hyperf\AsyncQueue\Command;
|
||||||
|
|
||||||
use Hyperf\AsyncQueue\Driver\DriverFactory;
|
use Hyperf\AsyncQueue\Driver\DriverFactory;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\AsyncQueue\Command;
|
namespace Hyperf\AsyncQueue\Command;
|
||||||
|
|
||||||
use Hyperf\AsyncQueue\Driver\DriverFactory;
|
use Hyperf\AsyncQueue\Driver\DriverFactory;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\AsyncQueue\Command;
|
namespace Hyperf\AsyncQueue\Command;
|
||||||
|
|
||||||
use Hyperf\AsyncQueue\Driver\DriverFactory;
|
use Hyperf\AsyncQueue\Driver\DriverFactory;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\AsyncQueue;
|
namespace Hyperf\AsyncQueue;
|
||||||
|
|
||||||
class ConfigProvider
|
class ConfigProvider
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\AsyncQueue\Driver;
|
namespace Hyperf\AsyncQueue\Driver;
|
||||||
|
|
||||||
use Hyperf\AsyncQueue\Exception\InvalidQueueException;
|
use Hyperf\AsyncQueue\Exception\InvalidQueueException;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\AsyncQueue\Driver;
|
namespace Hyperf\AsyncQueue\Driver;
|
||||||
|
|
||||||
use Hyperf\AsyncQueue\Environment;
|
use Hyperf\AsyncQueue\Environment;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\AsyncQueue\Driver;
|
namespace Hyperf\AsyncQueue\Driver;
|
||||||
|
|
||||||
use Hyperf\AsyncQueue\Exception\InvalidDriverException;
|
use Hyperf\AsyncQueue\Exception\InvalidDriverException;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\AsyncQueue\Driver;
|
namespace Hyperf\AsyncQueue\Driver;
|
||||||
|
|
||||||
use Hyperf\AsyncQueue\JobInterface;
|
use Hyperf\AsyncQueue\JobInterface;
|
||||||
|
@ -9,15 +9,14 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\AsyncQueue\Driver;
|
namespace Hyperf\AsyncQueue\Driver;
|
||||||
|
|
||||||
use Hyperf\AsyncQueue\Exception\InvalidQueueException;
|
use Hyperf\AsyncQueue\Exception\InvalidQueueException;
|
||||||
use Hyperf\AsyncQueue\JobInterface;
|
use Hyperf\AsyncQueue\JobInterface;
|
||||||
use Hyperf\AsyncQueue\Message;
|
use Hyperf\AsyncQueue\Message;
|
||||||
use Hyperf\AsyncQueue\MessageInterface;
|
use Hyperf\AsyncQueue\MessageInterface;
|
||||||
|
use Hyperf\Redis\RedisFactory;
|
||||||
use Psr\Container\ContainerInterface;
|
use Psr\Container\ContainerInterface;
|
||||||
use Redis;
|
|
||||||
|
|
||||||
class RedisDriver extends Driver
|
class RedisDriver extends Driver
|
||||||
{
|
{
|
||||||
@ -53,8 +52,7 @@ class RedisDriver extends Driver
|
|||||||
{
|
{
|
||||||
parent::__construct($container, $config);
|
parent::__construct($container, $config);
|
||||||
$channel = $config['channel'] ?? 'queue';
|
$channel = $config['channel'] ?? 'queue';
|
||||||
|
$this->redis = $container->get(RedisFactory::class)->get($config['redis']['pool'] ?? 'default');
|
||||||
$this->redis = $container->get(Redis::class);
|
|
||||||
$this->timeout = $config['timeout'] ?? 5;
|
$this->timeout = $config['timeout'] ?? 5;
|
||||||
$this->retrySeconds = $config['retry_seconds'] ?? 10;
|
$this->retrySeconds = $config['retry_seconds'] ?? 10;
|
||||||
$this->handleTimeout = $config['handle_timeout'] ?? 10;
|
$this->handleTimeout = $config['handle_timeout'] ?? 10;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\AsyncQueue;
|
namespace Hyperf\AsyncQueue;
|
||||||
|
|
||||||
class Environment
|
class Environment
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\AsyncQueue\Event;
|
namespace Hyperf\AsyncQueue\Event;
|
||||||
|
|
||||||
class AfterHandle extends Event
|
class AfterHandle extends Event
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\AsyncQueue\Event;
|
namespace Hyperf\AsyncQueue\Event;
|
||||||
|
|
||||||
class BeforeHandle extends Event
|
class BeforeHandle extends Event
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\AsyncQueue\Event;
|
namespace Hyperf\AsyncQueue\Event;
|
||||||
|
|
||||||
use Hyperf\AsyncQueue\MessageInterface;
|
use Hyperf\AsyncQueue\MessageInterface;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\AsyncQueue\Event;
|
namespace Hyperf\AsyncQueue\Event;
|
||||||
|
|
||||||
use Hyperf\AsyncQueue\MessageInterface;
|
use Hyperf\AsyncQueue\MessageInterface;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\AsyncQueue\Event;
|
namespace Hyperf\AsyncQueue\Event;
|
||||||
|
|
||||||
use Hyperf\AsyncQueue\Driver\DriverInterface;
|
use Hyperf\AsyncQueue\Driver\DriverInterface;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\AsyncQueue\Event;
|
namespace Hyperf\AsyncQueue\Event;
|
||||||
|
|
||||||
use Hyperf\AsyncQueue\MessageInterface;
|
use Hyperf\AsyncQueue\MessageInterface;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\AsyncQueue\Exception;
|
namespace Hyperf\AsyncQueue\Exception;
|
||||||
|
|
||||||
class InvalidDriverException extends \RuntimeException
|
class InvalidDriverException extends \RuntimeException
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\AsyncQueue\Exception;
|
namespace Hyperf\AsyncQueue\Exception;
|
||||||
|
|
||||||
class InvalidPackerException extends \RuntimeException
|
class InvalidPackerException extends \RuntimeException
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\AsyncQueue\Exception;
|
namespace Hyperf\AsyncQueue\Exception;
|
||||||
|
|
||||||
class InvalidQueueException extends \RuntimeException
|
class InvalidQueueException extends \RuntimeException
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\AsyncQueue;
|
namespace Hyperf\AsyncQueue;
|
||||||
|
|
||||||
use Hyperf\Contract\CompressInterface;
|
use Hyperf\Contract\CompressInterface;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\AsyncQueue;
|
namespace Hyperf\AsyncQueue;
|
||||||
|
|
||||||
interface JobInterface
|
interface JobInterface
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\AsyncQueue\Listener;
|
namespace Hyperf\AsyncQueue\Listener;
|
||||||
|
|
||||||
use Hyperf\AsyncQueue\Event\QueueLength;
|
use Hyperf\AsyncQueue\Event\QueueLength;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\AsyncQueue;
|
namespace Hyperf\AsyncQueue;
|
||||||
|
|
||||||
use Hyperf\Contract\CompressInterface;
|
use Hyperf\Contract\CompressInterface;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\AsyncQueue;
|
namespace Hyperf\AsyncQueue;
|
||||||
|
|
||||||
interface MessageInterface
|
interface MessageInterface
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Hyperf\AsyncQueue\Process;
|
namespace Hyperf\AsyncQueue\Process;
|
||||||
|
|
||||||
use Hyperf\AsyncQueue\Driver\DriverFactory;
|
use Hyperf\AsyncQueue\Driver\DriverFactory;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace HyperfTest\AsyncQueue;
|
namespace HyperfTest\AsyncQueue;
|
||||||
|
|
||||||
use Hyperf\AsyncQueue\Annotation\AsyncQueueMessage;
|
use Hyperf\AsyncQueue\Annotation\AsyncQueueMessage;
|
||||||
|
@ -9,11 +9,11 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace HyperfTest\AsyncQueue;
|
namespace HyperfTest\AsyncQueue;
|
||||||
|
|
||||||
use Hyperf\AsyncQueue\Driver\ChannelConfig;
|
use Hyperf\AsyncQueue\Driver\ChannelConfig;
|
||||||
use Hyperf\Di\Container;
|
use Hyperf\Di\Container;
|
||||||
|
use Hyperf\Redis\RedisFactory;
|
||||||
use Hyperf\Utils\ApplicationContext;
|
use Hyperf\Utils\ApplicationContext;
|
||||||
use Hyperf\Utils\Coroutine\Concurrent;
|
use Hyperf\Utils\Coroutine\Concurrent;
|
||||||
use Hyperf\Utils\Packer\PhpSerializerPacker;
|
use Hyperf\Utils\Packer\PhpSerializerPacker;
|
||||||
@ -60,6 +60,11 @@ class DriverTest extends TestCase
|
|||||||
$container->shouldReceive('make')->with(ChannelConfig::class, Mockery::any())->andReturnUsing(function ($class, $args) {
|
$container->shouldReceive('make')->with(ChannelConfig::class, Mockery::any())->andReturnUsing(function ($class, $args) {
|
||||||
return new ChannelConfig($args['channel']);
|
return new ChannelConfig($args['channel']);
|
||||||
});
|
});
|
||||||
|
$container->shouldReceive('get')->with(RedisFactory::class)->andReturnUsing(function ($_) {
|
||||||
|
$factory = Mockery::mock(RedisFactory::class);
|
||||||
|
$factory->shouldReceive('get')->with('default')->andReturn(new Redis());
|
||||||
|
return $factory;
|
||||||
|
});
|
||||||
|
|
||||||
ApplicationContext::setContainer($container);
|
ApplicationContext::setContainer($container);
|
||||||
|
|
||||||
|
@ -9,13 +9,13 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace HyperfTest\AsyncQueue;
|
namespace HyperfTest\AsyncQueue;
|
||||||
|
|
||||||
use Hyperf\AsyncQueue\Driver\ChannelConfig;
|
use Hyperf\AsyncQueue\Driver\ChannelConfig;
|
||||||
use Hyperf\AsyncQueue\Driver\RedisDriver;
|
use Hyperf\AsyncQueue\Driver\RedisDriver;
|
||||||
use Hyperf\AsyncQueue\Message;
|
use Hyperf\AsyncQueue\Message;
|
||||||
use Hyperf\Di\Container;
|
use Hyperf\Di\Container;
|
||||||
|
use Hyperf\Redis\RedisFactory;
|
||||||
use Hyperf\Utils\ApplicationContext;
|
use Hyperf\Utils\ApplicationContext;
|
||||||
use Hyperf\Utils\Context;
|
use Hyperf\Utils\Context;
|
||||||
use Hyperf\Utils\Packer\PhpSerializerPacker;
|
use Hyperf\Utils\Packer\PhpSerializerPacker;
|
||||||
@ -118,13 +118,18 @@ class RedisDriverTest extends TestCase
|
|||||||
$container = Mockery::mock(Container::class);
|
$container = Mockery::mock(Container::class);
|
||||||
$container->shouldReceive('get')->with(PhpSerializerPacker::class)->andReturn($packer);
|
$container->shouldReceive('get')->with(PhpSerializerPacker::class)->andReturn($packer);
|
||||||
$container->shouldReceive('get')->once()->with(EventDispatcherInterface::class)->andReturn(null);
|
$container->shouldReceive('get')->once()->with(EventDispatcherInterface::class)->andReturn(null);
|
||||||
$container->shouldReceive('get')->once()->with(\Redis::class)->andReturn(new Redis());
|
$container->shouldReceive('get')->with(\Redis::class)->andReturn(new Redis());
|
||||||
$container->shouldReceive('make')->with(ChannelConfig::class, Mockery::any())->andReturnUsing(function ($class, $args) {
|
$container->shouldReceive('make')->with(ChannelConfig::class, Mockery::any())->andReturnUsing(function ($class, $args) {
|
||||||
return new ChannelConfig($args['channel']);
|
return new ChannelConfig($args['channel']);
|
||||||
});
|
});
|
||||||
$container->shouldReceive('make')->with(Message::class, Mockery::any())->andReturnUsing(function ($class, $args) {
|
$container->shouldReceive('make')->with(Message::class, Mockery::any())->andReturnUsing(function ($class, $args) {
|
||||||
return new Message(...$args);
|
return new Message(...$args);
|
||||||
});
|
});
|
||||||
|
$container->shouldReceive('get')->with(RedisFactory::class)->andReturnUsing(function ($_) {
|
||||||
|
$factory = Mockery::mock(RedisFactory::class);
|
||||||
|
$factory->shouldReceive('get')->with('default')->andReturn(new Redis());
|
||||||
|
return $factory;
|
||||||
|
});
|
||||||
|
|
||||||
ApplicationContext::setContainer($container);
|
ApplicationContext::setContainer($container);
|
||||||
|
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace HyperfTest\AsyncQueue\Stub;
|
namespace HyperfTest\AsyncQueue\Stub;
|
||||||
|
|
||||||
use Hyperf\AsyncQueue\Job;
|
use Hyperf\AsyncQueue\Job;
|
||||||
|
@ -9,7 +9,6 @@ declare(strict_types=1);
|
|||||||
* @contact group@hyperf.io
|
* @contact group@hyperf.io
|
||||||
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
* @license https://github.com/hyperf/hyperf/blob/master/LICENSE
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace HyperfTest\AsyncQueue\Stub;
|
namespace HyperfTest\AsyncQueue\Stub;
|
||||||
|
|
||||||
use Hyperf\Contract\CompressInterface;
|
use Hyperf\Contract\CompressInterface;
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user