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
@@ -497,12 +497,62 @@ class ApplicationMailer < ActionMailer::Base
497
497
498
498
## Batch jobs
499
499
500
+
SolidQueue offers support for batching jobs. This allows you to track progress of a set of jobs,
501
+
and optionally trigger callbacks based on their status. It supports the following:
502
+
503
+
- Relating jobs to a batch, to track their status
504
+
- Three available callbacks to fire:
505
+
- `on_finish`: Fired when all jobs have finished, including retries. Fires even when some jobs have failed.
506
+
- `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`
507
+
- `on_failure`: Fired the _first_ time a job fails, after all retries are exhausted.
508
+
- If a job is part of a batch, it can enqueue more jobs for that batch using `batch#enqueue`
509
+
- Batches can be nested within other batches, creating a hierarchy. Outer batches will not finish until all nested batches have finished.
510
+
500
511
```rb
501
-
SolidQueue::JobBatch.enqueue(on_finish: BatchCompletionJob) do
0 commit comments