File tree Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Expand file tree Collapse file tree 1 file changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -128,6 +128,23 @@ use Stackkit\LaravelGoogleCloudTasksQueue\CloudTasksQueue;
128
128
CloudTasksQueue::configureHandlerUrlUsing(static fn(MyJob $job) => 'https://example.com/my-url/' . $job->something());
129
129
```
130
130
131
+ #### Configure worker options
132
+
133
+ You can configure worker options by using the ` configureWorkerOptionsUsing ` method on the ` CloudTasksQueue ` class.
134
+
135
+ ``` php
136
+ use Stackkit\LaravelGoogleCloudTasksQueue\IncomingTask;
137
+
138
+ CloudTasksQueue::configureWorkerOptionsUsing(function (IncomingTask $task) {
139
+ $queueTries = [
140
+ 'high' => 5,
141
+ 'low' => 1,
142
+ ];
143
+
144
+ return new WorkerOptions(maxTries: $queueTries[$task->queue()] ?? 1);
145
+ });
146
+ ```
147
+
131
148
### How it works and differences
132
149
133
150
Using Cloud Tasks as a Laravel queue driver is fundamentally different than other Laravel queue drivers, like Redis.
You can’t perform that action at this time.
0 commit comments