Skip to content

Commit cc4f92a

Browse files
committed
ICM: Advanced section added.
1 parent 860ef29 commit cc4f92a

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

README.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,25 @@ class Foo extends Command
8181
8282
```
8383

84+
## Advanced
85+
86+
Sometimes it is useful to set common mutex for a several commands. You can easily achieve this by setting them the same mutex name.
87+
By default, mutex name is generated based on a command's name and arguments. Override `getMutexName` method to change this:
88+
```php
89+
class Foo extends Command
90+
{
91+
use WithoutOverlapping;
92+
93+
public function getMutexName()
94+
{
95+
$foo = $this->argument('foo');
96+
return "icmutex-anything-you-need-here-{$foo}";
97+
}
98+
99+
// ...
100+
}
101+
```
102+
84103
## Troubleshooting
85104
86105
#### Trait included, but nothing happens?

0 commit comments

Comments
 (0)