r/laravel•
Hohlraum

wait/resolve hundreds of async jobs

I have a main queued job (async) that takes a report and using that data needs to execute potentially hundreds queries (some db, some rpc, some both) to build a resulting report. I'd like to queue (async) those child job queries as well (10-15 workers) to speed things up.

Nothing about this is difficult except this main job (async) program needs to know when all the child jobs (async) have completed. I know that the dispatch method returns the queue id. Is there any kind of built in mechanism for this parent job to wait on the resolution of those child jobs?

I'd thought about firing events upon completion but I think that would require using server side (no web client interaction here) event broadcasting/listening.

EDIT: added some clarification about the fact that all these jobs in question are asynchronous to allow parallel processing (potentially across multiple servers).

Posted Aug 25, 2017, 1:05 PM UTC · edited

23
Loading comments…