Skip to content

Commit 3de8444

Browse files
committed
ICM: Strategies section example added.
1 parent 04cf99f commit 3de8444

File tree

1 file changed

+21
-2
lines changed

1 file changed

+21
-2
lines changed

README.md

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ Prevents overlapping for artisan console commands.
1919
2. Use `Illuminated\Console\WithoutOverlapping` trait in your console command class:
2020
```php
2121
namespace App\Console\Commands;
22-
22+
2323
use Illuminate\Console\Command;
2424
use Illuminated\Console\WithoutOverlapping;
25-
25+
2626
class Foo extends Command
2727
{
2828
use WithoutOverlapping;
@@ -56,3 +56,22 @@ class Foo extends Command
5656
// ...
5757
}
5858
```
59+
60+
Or by using `setMutexStrategy()` method:
61+
62+
```php
63+
class Foo extends Command
64+
{
65+
use WithoutOverlapping;
66+
67+
public function __construct()
68+
{
69+
parent::__construct();
70+
71+
$this->setMutexStrategy('mysql');
72+
}
73+
74+
// ...
75+
}
76+
77+
```

0 commit comments

Comments
 (0)