We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0816f2b commit 1aab03dCopy full SHA for 1aab03d
console/lockable_trait.rst
@@ -43,4 +43,24 @@ that adds two convenient methods to lock and release commands::
43
}
44
45
46
+The LockableTrait will use the ``SemaphoreStore`` if available and will default
47
+to ``FlockStore`` otherwise. You can override this behavior by setting
48
+a ``$lockFactory`` property with your own lock factory::
49
+
50
+ // ...
51
+ use Symfony\Component\Console\Command\Command;
52
+ use Symfony\Component\Console\Command\LockableTrait;
53
+ use Symfony\Component\Lock\LockFactory;
54
55
+ class UpdateContentsCommand extends Command
56
+ {
57
+ use LockableTrait;
58
59
+ public function __construct(private LockFactory $lockFactory)
60
61
+ }
62
63
64
65
66
.. _`locks`: https://en.wikipedia.org/wiki/Lock_(computer_science)
0 commit comments