Closed rogeraraujo90 closed 4 years ago
No. If you queue jobs on the same queue name, and you have more than 1 worker process running, then the workers will take those jobs from the queue as quick as possible and process them independently of the other jobs, in parallel and not in series. Thats the whole point of a job queue.
You could:
Thank you for the response. I'll close this issue.
My team decided start a new worker that is responsible for watch one queue only (we still have five workers in parallel watching the default queue). Since we have just one worker we can have a serial
behaviour right?
Are you seeing some problem with this approach?
Ive not checked the code, but your logic assumes that the jobs are served from the oldest to the newest... that might be a good assumption, but it might be worth checking how the code pulls a job from the queue...
A quick look at rescue/php-resque and it says it uses Redis lpop
to get the job from the queue https://redis.io/commands/lpop - so this is an oldest out strategy and what you want (rather than some other random strategy)
I have two Jobs in my project that need run in a specific order. I want to know if I use the same queue name using the feature explained here: https://github.com/resquebundle/resque#more-features If can I trust that these Jobs will run in a serie.
If this is not the correct place to make questions, sorry about that. I can't find a better place.