使用webman命令行执行
php webman test
这个test脚本查询日志,然后推给队列,但是执行过程中报错
Timer can only be used in workerman running environment
use Webman\RedisQueue\Client
RedisQueue::send('xxx',$data);
报错信息:
In Timer.php line 157:
Timer can only be used in workerman running environment
test
win11
php8.3
升级完最新版
还是不行
手册里有说
Client::send()是异步的,它只能在workerman的运行环境中使用,命令行脚本请使用同步接口Redis::send()
webman/redis-queue 可能不是最新的,升级下
老大 我升级成功后,执行还是不行
可能是你哪里用了定时器导致的,命令里用不了定时器
我看了一下 官方里边又一个定时器
我看官方会用到定时器
好吧,你用的是 Client::send();
手册里有说
Client::send()是异步的,它只能在workerman的运行环境中使用,命令行脚本请使用同步接口Redis::send()
谢谢老大 解决了