Answer the question
In order to leave comments, you need to log in
How to run only one task in laravel queue?
There is a SAAS service in which there is a Users model, it has a connection with the Accounts model.
For each Accounts, tasks are generated and queued, some tasks, chains of tasks. Upon completion, more tasks are generated for the same account.
It all works on Horizon + redis.
I read the documentation, as far as I understand, this can be done using Redis::funnel('key') - but this option assumes that the worker will constantly take the task, break off - return the task and so on in a circle, and there are a lot of tasks. It is also not convenient to resolve timeouts - tasks must be performed one after another immediately.
1 worker 1 queue is also a so-so option - what about the fact that there are 10,000 users - respectively, and there are as many queues.
How to organize a queue so that tasks for different accounts can run in parallel, but only 1 task for one account.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question