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
In the example above, we will send jobs to the `reports` and `emails` queue. First, we will generate a report for given user with the `generate-report` job, after this, we will send an email with `email` job.
176
+
The `email` job will be executed only if the `generate-report` job was successful.
177
+
163
178
### Consuming the queue
164
179
165
180
Since we sent our sample job to queue `emails`, then we need to run the worker with the appropriate queue:
Copy file name to clipboardExpand all lines: docs/running-queues.md
+34
Original file line number
Diff line number
Diff line change
@@ -79,6 +79,40 @@ Note that there is no guarantee that the job will run exactly in 5 minutes. If m
79
79
80
80
We can also combine delayed jobs with priorities.
81
81
82
+
### Chained jobs
83
+
84
+
We can create sequences of jobs that run in a specific order. Each job in the chain will be executed after the previous job has completed successfully.
As you may notice, we can use the same options as in regular `push()` - we can set priority and delay, which are optional settings.
97
+
98
+
#### Important Differences from Regular `push()`
99
+
100
+
When using the `chain()` method, there are a few important differences compared to the regular `push()` method:
101
+
102
+
1.**Method Order**: Unlike the regular `push()` method where you set the priority and delay before pushing the job, in a chain you must set these properties after calling `push()` for each job:
2. **Configuration Scope**: Each configuration (priority, delay) only applies to the job that was just added to the chain.
115
+
82
116
### Running many instances of the same queue
83
117
84
118
As mentioned above, sometimes we may want to have multiple instances of the same command running at the same time. The queue is safe to use in that scenario with all databases as long as you keep the `skipLocked` to `true` in the config file. Only for SQLite3 driver, this setting is not relevant as it provides atomicity without the need for explicit concurrency control.
0 commit comments