Let's talk about the general situation first. The framework uses Laravel, the task queue uses Beanstalkd, and then {code ...} now I have a crawler task that needs to run every other time. During the crawling process, the crawler will add some subtasks to the task queue. For the next crawler task, you need to wait for the previous crawler to... let's talk about the general situation first. The framework uses Laravel and the task queue uses Beanstalkd.
Php artisan queue: listen
Now I have a crawler task that needs to run every other time. During the crawling process, the crawler will add some subtasks to the task queue.
The next crawler task can be started only after all the previous crawler tasks are completed.
However, the time used by the crawler task is unknown, and no method is found to determine whether the task queue is empty.
So how can I decide when (or under what conditions) to add the next crawler task to the task queue?
Reply content:
Let's talk about the general situation first. The framework uses Laravel and the task queue uses Beanstalkd.
Php artisan queue: listen
Now I have a crawler task that needs to run every other time. During the crawling process, the crawler will add some subtasks to the task queue.
The next crawler task can be started only after all the previous crawler tasks are completed.
However, the time used by the crawler task is unknown, and no method is found to determine whether the task queue is empty.
So how can I decide when (or under what conditions) to add the next crawler task to the task queue?
Search cron
I have not yet thought of a particularly good solution. I have the opportunity to discuss it.