Giter Site home page Giter Site logo

notes's Issues

--queue:listen bug

在root目录下执行 listen模式
nohup php think /www/wwwroot/think queue:listen --queue ordersuccess > myout.file 2>&1 &
是找不到think文件

work模式 在root目录下是可行的
nohup php /www/wwwroot/think queue:work --daemon --queue cashback > myout.file 2>&1 &

这是个bug!!!!!!

现在出2.0了,作者有空更新么?

对队列了解不是比较透彻
官方介绍稀少
对于队列中的监控,执行情况,调度过程等缺少比较易懂的介绍
2.0是thinkphp 5.1用的和5.0->1.x版本估计略有偏差
不知作者是否有空更新下对2.x相关的介绍与完善?

感谢,看了作者的笔记认知提高了不少。

接收端在接收到消息之后,去执行静态的模型去查询数据报错。

代码如下:
if ($isJobDone)
{
UserModel::get_user_info(100000); //此处调用的是静态的方法,若修改为db('User')->where($where)->find();则不报错

        // 如果任务执行成功, 记得删除任务
        $job->delete();
        Log::info("任务执行成功");

    }

具体错误信息如下:[ error ] [0]class not exists:app\model\User[/*/thinkphp/library/think/Loader.php:457]

若采用db('模型名称')去执行则不报错,想问下有没有什么办法可以使用模型的静态方法而不报错。版本是1.1.6和2.0.4都报错,Tp版本5.0.24 谢谢

队列创建成功,消费消息时,报错 Exception redis + 乱码

作者大大您好,我按照你的教程写了一个demo,队列已经成功建立,并且在redis里面可以看到队列数据。
但是在命令行执行命令:php think queue:work --queue testqueue,时,报错: [Exception] redis鎵╁睍鏈畨瑁?。。
然后,我想问下,queue的配置文件位置,是固定的吗?可以不可以放到其它位置。
我刚刚学习php不久,希望大牛能抽空回复一下。谢谢。

关于消息队列的可视化管理工具

感谢您的文章,已经读了好几遍。

现在有个问题一直很困惑。

因为在PHP-CLI里执行,很多东西不像 web 能直接给回馈。

那我们如何知道程序运行情况呢?

我现在主要是通过 LOG 来记录节点信息

比如 push 任务,我会记录成功还是失败

任务执行失败我也会记录。

但是通过 LOG 来查看这些信息总感觉很不可读,当队列数量起来了,我自己也看不懂

所以想请假一下您是否有用什么可视化管理工具来增强对任务执行情况的可读性

另外:

想 laravel 是有 failed_jobs 表里记录失败任务

设置还有官方维护的 laravel Horizon 。

请注意入口--可能找不到常量

thinkphp 执行队列不走index.php入口文件,走的是根目录下的think文件,具体可以使用get_included_files()打印看看,所以假如再index.php入口文件定义了常量,而且再队列里面又有使用到该常量的话,请注意,一般会报错找不到常量。

php think queue:work --queue helloJobQueue 执行没有结果?

你好,按照你的案例能发布成功,但是无法执行该任务

执行结果(没有任何的输出结果)

D:\wamp64\www\thinkphp5-study-line>php think queue:work --queue helloJobQueue

D:\wamp64\www\thinkphp5-study-line>php think queue:work --queue helloJobQueue

D:\wamp64\www\thinkphp5-study-line>php think queue:work --queue helloJobQueue

这个必须在Linux 环境吗?我当前的是Windows 环境

某个队列的消费者不足时,再给这个队列添加 work进程

你好,我现在使用tp5队列来做一个风控,买卖股票的订单会随着股票价钱波动产生盈亏,达到某个亏损值的时候我需要进行平仓,可以队列每一秒只能处理15个订单,我想问一下怎么可以加进程,让系统处理更多的订单呢

其他问题我都解决了,现在就差queue_failed

感谢楼主的笔记, 当初就想用think-queue,结果完全看不懂,还好现在入门级的操作会搞了。
任务失败始终没有进入我自己的处理, 按你的方法把queue.failed改成queue_failed也是没用哦

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.