Skip to content

Commit

Permalink
Merge pull request #5 from biiiiiigmonster/fix/readme
Browse files Browse the repository at this point in the history
Fix/readme
  • Loading branch information
biiiiiigmonster authored Oct 17, 2022
2 parents 80936df + 83d8d96 commit 0e64e47
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ class User extends Model
### Use Queue
When the relation data that we need to clear may be very large, it is a very good strategy to use `queue` to execute it.

Making it work is also simple, add the attribute name to the `clearQueue` property of your model.
Making it work is also simple, add the attribute name to the `clearConnection` property of your model.
```injectablephp
namespace App\Models;
Expand All @@ -149,15 +149,15 @@ class User extends Model
use HasClears;
/**
* The clearable that will be dispatch on this name queue.
* The clearable that will be dispatch on this connection queue.
*
* @var bool|string
* @var string|null
*/
protected $clearQueue = true;
protected $clearConnection = 'redis';
}
```
Once the `clearQueue` has been declared, the `posts`'s clear behavior will be executed using the queue, reducing the serial pressure.
> Tips: You can also set it as a string `protected $clearQueue = 'queue-name';`, which will run in the named queue.
Once the `clearConnection` has been declared, the `posts`'s clear behavior will be executed using the queue connection.
> Tips: Even you can also set `protected $clearQueue` as a string, which will run in the named queue.
### Clearing At Runtime
At runtime, you may instruct a model instance to using the `clear` or `setClears` method just like
Expand Down

0 comments on commit 0e64e47

Please sign in to comment.