I extracted an ActiveJob batching utility from AngryBuilding
I extracted an ActiveJob batching utility from AngryBuilding
@rstankov That looks very useful, I remember needing something like this in the past.
One thing I'm wondering is how granular error handling should be. Right now, I see that the success handler is triggered if all the jobs succeed (https://github.com/RStankov/AngryBatch/blob/main/lib/angry_batch/batch.rb#L49-L57), but I feel like you'd want to know which failed and which succeeded. Like, maybe a "success" handler for all succeeding, "failure" for some failing, and "complete" with lists of succeding and failing jobs?
I'm open to suggestions for better error handling.
I tried a couple of approaches, but I didn't like any of them.
Thus, I left with the simplest one, which will allow me to add more granular ones later.
@AndrewRadev With my current usage of AngryBatch, I haven't encountered many issues with the current error handling approach.
Most of the enqueue jobs failed due to network issues, but after a couple of retries, they completed.