@@ -100,25 +100,6 @@ class MyProtectedCommand extends Command
100100
101101# # Advanced
102102
103- # ## Mutex for several commands
104-
105- Sometimes it is useful to set common mutex for a several commands. You can easily achieve this by setting them the same mutex name.
106- By default, mutex name is generated based on a command' s name and arguments. To change this, just override `getMutexName` method in your command:
107-
108- ```php
109- class MyProtectedCommand extends Command
110- {
111- use WithoutOverlapping;
112-
113- public function getMutexName()
114- {
115- return "icmutex-for-command1-and-command2";
116- }
117-
118- // ...
119- }
120- ```
121-
122103# ## Mutex timeout
123104
124105By default mutex is checking for a running command, and if it finds such - it just exits. However, you can manually set
@@ -161,6 +142,25 @@ There are three possible options for `$mutexTimeout` field:
161142- `{milliseconds}` - check, and wait for a maximum of milliseconds specified;
162143- `null` - wait, till running instance finish its execution;
163144
145+ ### Mutex for several commands
146+
147+ Sometimes it is useful to set common mutex for a several commands. You can easily achieve this by setting them the same mutex name.
148+ By default, mutex name is generated based on a command' s name and arguments. To change this, just override ` getMutexName` method in your command:
149+
150+ ` ` ` php
151+ class MyProtectedCommand extends Command
152+ {
153+ use WithoutOverlapping;
154+
155+ public function getMutexName()
156+ {
157+ return " icmutex-for-command1-and-command2" ;
158+ }
159+
160+ // ...
161+ }
162+ ` ` `
163+
164164# # Troubleshooting
165165
166166# ## Trait included, but nothing happens?
0 commit comments