Answer the question
In order to leave comments, you need to log in
How to implement task execution in laravel?
Good afternoon. There is a task to implement such a mechanism (schematically):
1. An application is created on the site in a certain category
2. It is necessary to find a user who is ready to complete an application from this category
3. The user receives a notification that there is an application for him and he decides to execute or skip
4. If the user decided to skip then the application should go to another user waiting for an application from this category
How to implement a user search mechanism for this application until someone completes it?
At the moment, everything works like this
1. An application is created immediately, a task is created in queues for one application
2. After that, this application is executed according to the crown and if the user skips, then everything from point 1 is repeated
The problem is that when laravel starts the queue, it only executes one task per minute (the cron runs every minute) and in fact if a lot of users miss it, then the application will not arrive soon + there are a lot of such applications, the process
is now delayed in test mode per day, about 20 such applications processed but planned from 200 so that at least 10-20 applications are processed at a time The
question is how to proceed? it is advisable not to resort to redis supervisor, etc.
Sorry for the complicated explanation =)
Answer the question
In order to leave comments, you need to log in
Why are there queues at all? When creating an application, immediately send this application to the contractor, in case of refusal - to the next one. Use CRON to process those requests that have not received a response for some time. And it would be nice to see the code.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question