Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
marickvantuil authored May 26, 2024
1 parent 3494a12 commit 7dd1012
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,23 @@ use Stackkit\LaravelGoogleCloudTasksQueue\CloudTasksQueue;
CloudTasksQueue::configureHandlerUrlUsing(static fn(MyJob $job) => 'https://example.com/my-url/' . $job->something());
```

#### Configure worker options

You can configure worker options by using the `configureWorkerOptionsUsing` method on the `CloudTasksQueue` class.

```php
use Stackkit\LaravelGoogleCloudTasksQueue\IncomingTask;

CloudTasksQueue::configureWorkerOptionsUsing(function (IncomingTask $task) {
$queueTries = [
'high' => 5,
'low' => 1,
];

return new WorkerOptions(maxTries: $queueTries[$task->queue()] ?? 1);
});
```

### How it works and differences

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

0 comments on commit 7dd1012

Please sign in to comment.