File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -43,4 +43,24 @@ that adds two convenient methods to lock and release commands::
4343 }
4444 }
4545
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+
4666.. _`locks` : https://en.wikipedia.org/wiki/Lock_(computer_science)
You can’t perform that action at this time.
0 commit comments