Skip to content

Commit 7ff3368

Browse files
Update README.md
1 parent a6189b4 commit 7ff3368

File tree

1 file changed

+11
-82
lines changed

1 file changed

+11
-82
lines changed

README.md

Lines changed: 11 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -15,20 +15,11 @@ This package allows Google Cloud Tasks to be used as the queue driver.
1515
<img src="/assets/cloud-tasks-home.png" width="100%">
1616
</p>
1717

18-
<details>
19-
<summary>
20-
Requirements
21-
</summary>
18+
### Requirements
2219

23-
<br>
24-
This package requires Laravel 10 or higher and supports MySQL 8 and PostgreSQL 15. Might support older database versions too, but package hasn't been tested for it.
20+
This package requires Laravel 10 or 11.
2521

26-
Please check the [Laravel support policy](https://laravel.com/docs/master/releases#support-policy) table for supported
27-
Laravel and PHP versions.
28-
</details>
29-
<details>
30-
<summary>Installation</summary>
31-
<br>
22+
### Installation
3223

3324
Require the package using Composer
3425

@@ -63,15 +54,14 @@ Add a new queue connection to `config/queue.php`
6354
],
6455
```
6556

66-
If you are using separate services for dispatching and handling tasks, you may want to change the following settings:
57+
If you are using separate services for dispatching and handling tasks, and your application only dispatches jobs and should not be able to handle jobs, you may disable the task handler from `config/cloud-tasks.php`:
6758

6859
```php
69-
// config/cloud-tasks.php
70-
71-
// If the application only dispatches jobs
7260
'disable_task_handler' => env('STACKKIT_CLOUD_TASKS_DISABLE_TASK_HANDLER', false),
7361
```
7462

63+
Finally, change the `QUEUE_CONNECTION` to the newly defined connection.
64+
7565
```dotenv
7666
QUEUE_CONNECTION=cloudtasks
7767
```
@@ -136,11 +126,8 @@ use Stackkit\LaravelGoogleCloudTasksQueue\CloudTasksQueue;
136126
CloudTasksQueue::configureHandlerUrlUsing(static fn(MyJob $job) => 'https://example.com/my-url/' . $job->something());
137127
```
138128

139-
<details>
140-
<summary>
141-
How it works & Differences
142-
</summary>
143-
<br>
129+
### How it works and differences
130+
144131
Using Cloud Tasks as a Laravel queue driver is fundamentally different than other Laravel queue drivers, like Redis.
145132

146133
Typically a Laravel queue has a worker that listens to incoming jobs using the `queue:work` / `queue:listen` command.
@@ -149,53 +136,9 @@ your application with the job payload. There is no need to run a `queue:work/lis
149136

150137
#### Good to know
151138

152-
- Backoff, retries, max tries, retryUntil are all handled by Laravel. All these options are ignored in the Cloud Tasks
153-
configuration.
154-
155-
</details>
156-
<details>
157-
<summary>Dashboard (beta)</summary>
158-
<br>
159-
The package comes with a beautiful dashboard that can be used to monitor all queued jobs.
160-
161-
162-
<img src="/assets/dashboard.png" width="100%">
139+
Cloud Tasks has it's own retry configuration options: maximum number of attempts, retry duration, min/max backoff and max doublings. All of these options are ignored by this package. Instead, you may configure max attempts, retry duration and backoff strategy right from Laravel.
163140

164-
---
165-
166-
_Experimental_
167-
168-
The dashboard works by storing all outgoing tasks in a database table. When Cloud Tasks calls the application and this
169-
package handles the task, we will automatically update the tasks' status, attempts
170-
and possible errors.
171-
172-
There is probably a (small) performance penalty because each task dispatch and handling does extra database read and
173-
writes.
174-
Also, the dashboard has not been tested with high throughput queues.
175-
176-
---
177-
178-
179-
To make use of it, enable it through the `.env` file:
180-
181-
```dotenv
182-
STACKKIT_CLOUD_TASKS_DASHBOARD_ENABLED=true
183-
STACKKIT_CLOUD_TASKS_DASHBOARD_PASSWORD=MySecretLoginPasswordPleaseChangeThis
184-
```
185-
186-
Then publish its assets and migrations:
187-
188-
```console
189-
php artisan vendor:publish --tag=cloud-tasks
190-
php artisan migrate
191-
```
192-
193-
The dashboard is accessible at the URI: /cloud-tasks
194-
195-
</details>
196-
<details>
197-
<summary>Authentication</summary>
198-
<br>
141+
### Authentication
199142

200143
Set the `GOOGLE_APPLICATION_CREDENTIALS` environment variable with a path to the credentials file.
201144

@@ -210,20 +153,6 @@ works:
210153
4. Cloud Tasks Task Deleter
211154
5. Service Account User
212155

213-
</details>
214-
<details>
215-
<summary>Security</summary>
216-
<br>
217-
The job handler requires each request to have an OpenID token. In the installation step we set the service account email, and with that service account, Cloud Tasks will generate an OpenID token and send it along with the job payload to the handler.
218-
219-
This package verifies that the token is digitally signed by Google. Only Google Tasks will be able to call your handler.
156+
### Upgrading
220157

221-
More information about OpenID Connect:
222-
223-
https://developers.google.com/identity/protocols/oauth2/openid-connect
224-
</details>
225-
<details>
226-
<summary>Upgrading</summary>
227-
<br>
228158
Read [UPGRADING.MD](UPGRADING.md) on how to update versions.
229-
</details>

0 commit comments

Comments
 (0)