Open webphplove opened 3 years ago
Describe the bug A clear and concise description of what the bug is.
我开启了一个进程处理redis的发布订阅,代码如下:
<?php namespace App\Process; use Swoft\Bean\Annotation\Mapping\Bean; use Swoft\Db\Exception\DbException; use Swoft\Log\Helper\CLog; use Swoft\Process\Process; use Swoft\Process\UserProcess; use Swoft\Redis\Redis; /** * Class QueueSubscribeProcess * @package App\Process * @Bean() */ class QueueSubscribeProcess extends UserProcess { /** * @param Process $process * * @throws DbException */ public function run(Process $process): void { while (true) { ini_set('default_socket_timeout', -1); //不超时 // 订阅 2 个频道 Redis::subscribe(['test'], function ($redis, $pattern, $chan, $msg){ echo "Pattern: $pattern\n"; echo "Channel: $chan\n"; echo "Payload: $msg\n"; }); Coroutine::sleep(3); } } }
我使用redis发布消息,这个订阅没有反应。 我也通过swoft程序发布消息,而程序的订阅和redis客户端订阅频道,也没有任何反应
cli 测试有反应的 看看 使用是否正确 框架没有做封装 使用的 redis 扩展
我用swoole 的redis有反应, 而用swoft 一定反应都没有
Describe the bug A clear and concise description of what the bug is.
我开启了一个进程处理redis的发布订阅,代码如下:
我使用redis发布消息,这个订阅没有反应。 我也通过swoft程序发布消息,而程序的订阅和redis客户端订阅频道,也没有任何反应