redis - 关于php任务队列的问题
阿神
阿神 2017-04-25 09:03:15
0
1
794

最近在学习redis,list数据类型很适合做任务队列。之前没有接触过,我的理解是创建任务队列,然后做个定时任务去操作这个队列,比如取前10个去执行,执行完弹出,以此循环,直到队列内没有任务,但是这个定时任务还是会每隔多久去查询一次是否有任务要执行。这样理解对吗?

阿神
阿神

闭关修行中......

reply all(1)
Peter_Zhu

That’s not entirely correct. You can use a cron scheduled task to regularly fetch tasks from the task queue for execution.
You can also run a php-worker daemon to continuously execute tasks. As long as the previous task is completed, it will go to the task queue to fetch the next task and start execution.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template