B
B
boobooking2018-08-27 11:09:19
Message Queues
boobooking, 2018-08-27 11:09:19

How to add dependencies between Jobs in Laravel?

Prompt / Help to add dependencies between Jobs in Laravel. It is necessary to implement an "add-on" over jobs - which takes into account their dependencies. Run job B only when all Job A tasks have been processed.
The global task is as follows:
I am loading a large XML file with declarations. I want to run the processing of each ad as a separate Job in order to parallelize the execution of tasks of the same type.
But after processing all ads (all jobs), it is necessary to generate a loading report. How can I track that all the tasks that were launched specifically within the framework of processing this XML (other XML can be loaded in parallel) were completed (successfully or unsuccessfully)? How would you implement this functionality?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
J
JhaoDa, 2018-08-27
@JhaoDa

Catch the events https://laravel.com/docs/5.6/queues#job-events and check what task is running/done/failed/etc.

K
Kirill Nesmeyanov, 2018-08-28
@SerafimArts

And queues of queues (no matter how it sounds) are not suitable, are they? https://laravel.com/docs/5.6/queues#job-chaining

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question