@@ -24,21 +24,21 @@ Locks are used to guarantee exclusive access to some shared resource. In
24
24
Symfony applications, you can use locks for example to ensure that a command is
25
25
not executed more than once at the same time (on the same or different servers).
26
26
27
- Locks are created using a :class: `Symfony\\ Component\\ Lock\\ Factory ` class,
27
+ Locks are created using a :class: `Symfony\\ Component\\ Lock\\ LockFactory ` class,
28
28
which in turn requires another class to manage the storage of locks::
29
29
30
30
use Symfony\Component\Lock\LockFactory;
31
31
use Symfony\Component\Lock\Store\SemaphoreStore;
32
32
33
33
$store = new SemaphoreStore();
34
- $factory = new Factory ($store);
34
+ $factory = new LockFactory ($store);
35
35
36
36
.. versionadded :: 4.4
37
37
38
38
The ``Symfony\Component\Lock\LockFactory `` class was introduced in Symfony
39
39
4.4. In previous versions it was called ``Symfony\Component\Lock\Factory ``.
40
40
41
- The lock is created by calling the :method: `Symfony\\ Component\\ Lock\\ Factory ::createLock `
41
+ The lock is created by calling the :method: `Symfony\\ Component\\ Lock\\ LockFactory ::createLock `
42
42
method. Its first argument is an arbitrary string that represents the locked
43
43
resource. Then, a call to the :method: `Symfony\\ Component\\ Lock\\ LockInterface::acquire `
44
44
method will try to acquire the lock::
@@ -61,7 +61,7 @@ method can be safely called repeatedly, even if the lock is already acquired.
61
61
Unlike other implementations, the Lock Component distinguishes locks
62
62
instances even when they are created for the same resource. If a lock has
63
63
to be used by several services, they should share the same ``Lock `` instance
64
- returned by the ``Factory ::createLock `` method.
64
+ returned by the ``LockFactory ::createLock `` method.
65
65
66
66
.. tip ::
67
67
@@ -88,7 +88,7 @@ they can be decorated with the ``RetryTillSaveStore`` class::
88
88
89
89
$store = new RedisStore(new \Predis\Client('tcp://localhost:6379'));
90
90
$store = new RetryTillSaveStore($store);
91
- $factory = new Factory ($store);
91
+ $factory = new LockFactory ($store);
92
92
93
93
$lock = $factory->createLock('notification-flush');
94
94
$lock->acquire(true);
0 commit comments