You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+53-3Lines changed: 53 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -546,12 +546,62 @@ class ApplicationMailer < ActionMailer::Base
546
546
547
547
## Batch jobs
548
548
549
+
SolidQueue offers support for batching jobs. This allows you to track progress of a set of jobs,
550
+
and optionally trigger callbacks based on their status. It supports the following:
551
+
552
+
- Relating jobs to a batch, to track their status
553
+
- Three available callbacks to fire:
554
+
- `on_finish`: Fired when all jobs have finished, including retries. Fires even when some jobs have failed.
555
+
- `on_success`: Fired when all jobs have succeeded, including retries. Will not fire if any jobs have failed, but will fire if jobs have been discarded using `discard_on`
556
+
- `on_failure`: Fired the _first_ time a job fails, after all retries are exhausted.
557
+
- If a job is part of a batch, it can enqueue more jobs for that batch using `batch#enqueue`
558
+
- Batches can be nested within other batches, creating a hierarchy. Outer batches will not finish until all nested batches have finished.
559
+
549
560
```rb
550
-
SolidQueue::JobBatch.enqueue(on_finish: BatchCompletionJob) do
0 commit comments