Skip to content

Commit 6299e37

Browse files
committed
updates README.md
1 parent a8b3b07 commit 6299e37

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

README.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ This package is for you if...
88
- you often create jobs to use just one single time **after a deployment**
99
- you sometimes **forgot to execute** that one specific job and stuff got crazy
1010
- your code gets **cluttered with jobs**, that are not being used anymore
11-
- you seed or process data in a migration file (which is a big no-no!)
11+
- you often seed or process data **in a migration file** (which is a big no-no!)
1212

13-
And the best thing: They work as easy as **Laravel migrations**!
13+
And the best thing: It works as easy as **Laravel migrations**!
1414

1515
## Installation
1616

@@ -148,7 +148,7 @@ public function process(): void
148148
By default, the operation is being processed ***asyncronously*** (based on your configuration) by dispatching the job `OneTimeOperationProcessJob`.
149149

150150
You can also execute the code syncronously by setting the `$async` flag to `false`.
151-
_(this is only recommended for small operations, since the processing of these operations will be part of the deployment process)_
151+
_(this is only recommended for small operations, since the processing of these operations should be part of the deployment process)_
152152

153153
### Processing the operations
154154

@@ -170,23 +170,24 @@ After that, this operation will not be processed anymore.
170170

171171
### Dispatching Jobs syncronously or asyncronously
172172

173-
By default, all operations are being exectued with the `OneTimeOperationProcessJob` based on your `queue.default` configuration.
174-
By providing the `--sync` or `--async` option, the `$async` attribute in all the files will be ignored and the operation will be executed based on the given flag.
173+
For each operation a `OneTimeOperationProcessJob` is being dispatched,
174+
either with `dispatch()` oder `dispatchSync()` based on the `$async` attribute in the operation file.
175+
176+
By providing the `--sync` or `--async` option with the `operations:process` command, you can force a syncronously/asyncronously execution and ignore the attribute:
175177

176178
```shell
177-
php artisan operations:process --async // force OneTimeOperationProcessJob::dispatch()
178-
php artisan operations:process --sync // force OneTimeOperationProcessJob::dispatchSync()
179+
php artisan operations:process --async // force dispatch()
180+
php artisan operations:process --sync // force dispatchSync()
179181
```
180182

181183
**Hint!** If `operation:process` is part of your deployment process, it is **not recommended** to process the operations syncronously,
182184
since an error in your operation could make your whole deployment fail.
183185

184-
### Re-run an operation manually
186+
### Re-run an operation
185187

186188
![Laravel One-Time Operations - Re-run an operation manually](https://user-images.githubusercontent.com/65356688/224440344-3d095730-12c3-4a2c-b4c3-42a8b6d60767.png)
187189

188-
If something went wrong, you can process an operation manually by providing the **name of the operation** as parameter in `operations:process`.
189-
This will process the operation again, even if it was processed before (confirmation is required).
190+
If something went wrong (or if you just feel like it), you can process an operation again by providing the **name of the operation** as parameter in `operations:process`.
190191

191192
```shell
192193
php artisan operations:process XXXX_XX_XX_XXXXXX_awesome_operation
@@ -210,7 +211,7 @@ Filter the list with the available filters `pending`, `processed` and `disposed`
210211

211212
- `pending` - Operations, that have not been processed yet
212213
- `processed` - Operations, that have been processed
213-
- `disposed` - Operations, that have been processed and the files were already deleted (which is okay)
214+
- `disposed` - Operations, that have been processed and the files were already deleted
214215

215216
```shell
216217
php artisan operations:show pending // show only pending operations

0 commit comments

Comments
 (0)