Skip to content

Commit 7dd1012

Browse files
Update README.md
1 parent 3494a12 commit 7dd1012

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

README.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,23 @@ use Stackkit\LaravelGoogleCloudTasksQueue\CloudTasksQueue;
128128
CloudTasksQueue::configureHandlerUrlUsing(static fn(MyJob $job) => 'https://example.com/my-url/' . $job->something());
129129
```
130130

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+
131148
### How it works and differences
132149

133150
Using Cloud Tasks as a Laravel queue driver is fundamentally different than other Laravel queue drivers, like Redis.

0 commit comments

Comments
 (0)