You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -64,10 +64,10 @@ Overlapping can be prevented by various strategies:
64
64
- `redis`
65
65
- `memcached`
66
66
67
-
Default `file` strategy is fine fora small applications, which are deployed on a single server.
68
-
If your application is more complex and, for example, is deployed on a several nodes, then you probably would like to use some other mutex strategy.
67
+
Default `file` strategy is fine for small applications, which are deployed on a single server.
68
+
If your application is more complex anddeployed on several nodes, then you probably would like to use another mutex strategy.
69
69
70
-
You can change mutex strategy by specifying `$mutexStrategy` field:
70
+
You can change the mutex strategy by specifying `$mutexStrategy` field:
71
71
72
72
```php
73
73
class ExampleCommand extends Command
@@ -102,10 +102,10 @@ class ExampleCommand extends Command
102
102
103
103
### Set custom timeout
104
104
105
-
By defaultmutex is checking for a running command, and if it finds such, it just exits. However, you can manuallyset
106
-
timeout for a mutex, so it can waitfor another command to finish it's execution, instead of just quitting immediately.
105
+
By default, the mutex is checking for a running command, and if it finds such, it just exits. However, you can manually
106
+
set the timeout for a mutex, so it can waitfor another command to finish its execution, instead of just quitting immediately.
107
107
108
-
You can change mutex timeout by specifying `$mutexTimeout` field:
108
+
You can change the mutex timeout by specifying `$mutexTimeout` field:
109
109
110
110
```php
111
111
class ExampleCommand extends Command
@@ -140,12 +140,14 @@ There are three possible options for `$mutexTimeout` field:
140
140
141
141
- `0` - check without waiting (default);
142
142
- `{milliseconds}` - check, and waitfor a maximum of milliseconds specified;
143
-
- `null` - wait, till running command finish it's execution;
143
+
- `null` - wait, till running command finish its execution;
144
144
145
145
### Handle several commands
146
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:
147
+
Sometimes it is useful to set common mutex for 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.
149
+
150
+
To change this, override `getMutexName` method in your command:
149
151
150
152
```php
151
153
class ExampleCommand extends Command
@@ -163,8 +165,9 @@ class ExampleCommand extends Command
163
165
164
166
### Custom mutex file storage
165
167
166
-
If you're using `file` strategy, mutex files will be stored at `storage/app` folder, by default. However, you can change storage
167
-
folder by overriding `getMutexFileStorage` method in your command:
168
+
If you're using `file` strategy, mutex files will be stored in the `storage/app` folder, by default.
169
+
170
+
You can change the storage folder by overriding `getMutexFileStorage` method in your command:
168
171
169
172
```php
170
173
class ExampleCommand extends Command
@@ -220,7 +223,8 @@ class ExampleCommand extends Command
220
223
221
224
### Several traits conflict?
222
225
223
-
If you're using some other cool `illuminated/console-%` packages, well, then you can find yourself getting "traits conflict".
226
+
If you're using another `illuminated/console-%` package, then you can find yourself getting into the "traits conflict".
227
+
224
228
For example, if you're trying to build [loggable command](https://github.com/dmitry-ivanov/laravel-console-logger), which is protected against overlapping:
225
229
226
230
```php
@@ -233,10 +237,10 @@ class ExampleCommand extends Command
233
237
}
234
238
```
235
239
236
-
You'll get fatal error, the "traits conflict", because both of these traits are overriding `initialize` method:
237
-
>If two traits insert a method with the same name, a fatal error is produced, if the conflict is not explicitly resolved.
240
+
You'll get the fatal error - the traits conflict, because of both of these traits are overriding `initialize` method:
241
+
>If two traits insert a method with the same name, a fatal error is produced, if the conflict is not explicitly resolved.
238
242
239
-
But don't worry, solution is very simple. Override `initialize` method by yourself, and initialize traits in required order:
243
+
Override `initialize` method by yourself, and initialize traits in required order:
0 commit comments