Answer the question
In order to leave comments, you need to log in
How do I find out how many tasks are in front of me in the Lumen/Laravel task queue in Redis?
The task queue is stored in Redis. Lumen / Laravel version 6.x
How can I find out from a task at any given time id
how many more tasks are ahead of it? Laravel did not find it
in the description of queues.
At the moment of creating a task, you can read the size of the queue through RedisQueue.size() , but what about later, after a while?
I look, when there are tasks in the queue, three keys appear:
"queues:xxxxxx.queue" LIST
"queues:xxxxxx.queue:notify" LIST
"queues:xxxxxx.queue:reserved" ZSET
id
tasks in the items in this list. Crutch, but so far this is the main option. :notify
stores only "1" with the same number as the first one. :reserved
one seems to store the currently running task.
Answer the question
In order to leave comments, you need to log in
You can find out through LLEN how many elements are in the queue at any time. If the queues in one thread are sequentially raked, then it is possible to calculate the position of the task knowing how much has been created / completed, but if not, then only poking around in the queues.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question