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
+2-20Lines changed: 2 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -598,7 +598,6 @@ and optionally trigger callbacks based on their status. It supports the followin
598
598
- `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`
599
599
- `on_failure`: Fired when all jobs have finished, including retries. Will only fire if one or more jobs have failed.
600
600
- If a job is part of a batch, it can enqueue more jobs for that batch using `batch#enqueue`
601
-
- Batches can be nested within other batches, creating a hierarchy. Outer batches will not fire callbacks until all nested jobs have finished.
602
601
- Attaching arbitrary metadata to a batch
603
602
604
603
```rb
@@ -609,20 +608,6 @@ class SleepyJob < ApplicationJob
609
608
end
610
609
end
611
610
612
-
class MultiStepJob < ApplicationJob
613
-
def perform
614
-
batch.enqueue do
615
-
SleepyJob.perform_later(5)
616
-
# Because of this nested batch, the top-level batch won't finish until the inner,
617
-
# 10 second job finishes
618
-
# Both jobs will still run simultaneously
619
-
SolidQueue::Batch.enqueue do
620
-
SleepyJob.perform_later(10)
621
-
end
622
-
end
623
-
end
624
-
end
625
-
626
611
class BatchFinishJob < ApplicationJob
627
612
def perform(batch) # batch is always the default first argument
628
613
Rails.logger.info "Good job finishing all jobs"
@@ -653,12 +638,9 @@ end
653
638
654
639
### Batch options
655
640
656
-
As part of the processing of a batch, some jobs are automatically enqueued:
657
-
658
-
- A `SolidQueue::Batch::BatchMonitorJob` is enqueued for every `Batch` being processed
659
-
- In the case of an empty batch, a `SolidQueue::Batch::EmptyJob` is enqueued
641
+
In the case of an empty batch, a `SolidQueue::Batch::EmptyJob` is enqueued.
660
642
661
-
By default, these jobs run on the `default` queue. You can specify an alternative queue for them in an initializer:
643
+
By default, this jobs run on the `default` queue. You can specify an alternative queue for it in an initializer:
662
644
663
645
```rb
664
646
Rails.application.config.after_initialize do # or to_prepare
0 commit comments