@@ -87,7 +87,7 @@ you can decorate it with the ``RetryTillSaveStore``.
87
87
88
88
$lock->acquire(true);
89
89
90
- Expirable Locks
90
+ Expiring Locks
91
91
---------------
92
92
93
93
Working with a remote ``Store `` is hard. There is now way for the remote
@@ -96,12 +96,12 @@ Due to bugs, fatal errors or segmentation fault, we can't guarantee that the
96
96
``release() `` method will be called, which would cause a ``resource `` to be locked
97
97
infinitely.
98
98
99
- To fill this gap, the remote ``Stores `` provide an expirable mechanism: The lock
100
- is acquired for a defined amount of time (named TTL for Time To Live).
99
+ To fill this gap, the remote ``Stores `` provide an expiration mechanism: The
100
+ lock is acquired for a defined amount of time (named TTL for Time To Live).
101
101
When the timeout occurred, the lock is automatically released even if the locker
102
102
don't call the ``release() `` method.
103
103
104
- That's why, when you create a lock on an expirable ``Store ``. You have to choose
104
+ That's why, when you create a lock on an expiring ``Store ``. You have to choose
105
105
carefully the correct TTL. When too low, you take the risk to "lose" the lock
106
106
(and someone else acquire it) whereas you don't finish your task.
107
107
When too high and the process crash before you call the ``release() `` method,
@@ -126,7 +126,7 @@ the ``resource`` will stay lock till the timeout.
126
126
.. tip ::
127
127
128
128
To avoid letting the Lock in a locking state, try to always release an
129
- expirable lock by wrapping the job in a try/catch block for instance.
129
+ expiring lock by wrapping the job in a try/catch block for instance.
130
130
131
131
When you have to work on a really long task, you should not set the TTL to
132
132
overlap the duration of this task. Instead, the Lock Component expose a
@@ -162,22 +162,22 @@ This component provides several adapters ready to use in your applications.
162
162
163
163
Here is a small summary of available ``Stores `` and their capabilities.
164
164
165
- +----------------------------------------------+--------+----------+----------- +
166
- | Store | Scope | Blocking | Expirable |
167
- +==============================================+========+==========+=========== +
168
- | :ref: `FlockStore <lock-store-flock >` | local | yes | no |
169
- +----------------------------------------------+--------+----------+----------- +
170
- | :ref: `MemcachedStore <lock-store-memcached >` | remote | no | yes |
171
- +----------------------------------------------+--------+----------+----------- +
172
- | :ref: `RedisStore <lock-store-redis >` | remote | no | yes |
173
- +----------------------------------------------+--------+----------+----------- +
174
- | :ref: `SemaphoreStore <lock-store-semaphore >` | local | yes | no |
175
- +----------------------------------------------+--------+----------+----------- +
165
+ +----------------------------------------------+--------+----------+----------+
166
+ | Store | Scope | Blocking | Expiring |
167
+ +==============================================+========+==========+==========+
168
+ | :ref: `FlockStore <lock-store-flock >` | local | yes | no |
169
+ +----------------------------------------------+--------+----------+----------+
170
+ | :ref: `MemcachedStore <lock-store-memcached >` | remote | no | yes |
171
+ +----------------------------------------------+--------+----------+----------+
172
+ | :ref: `RedisStore <lock-store-redis >` | remote | no | yes |
173
+ +----------------------------------------------+--------+----------+----------+
174
+ | :ref: `SemaphoreStore <lock-store-semaphore >` | local | yes | no |
175
+ +----------------------------------------------+--------+----------+----------+
176
176
177
177
.. tip ::
178
178
179
179
Calling the :method: `Symfony\\ Component\\ Lock\\ LockInterface::refresh `
180
- method on a Lock created from a non expirable ``Store `` like
180
+ method on a Lock created from a non expiring ``Store `` like
181
181
:ref: `FlockStore <lock-store-flock >` will do nothing.
182
182
183
183
.. _lock-store-flock :
@@ -257,7 +257,7 @@ classes::
257
257
SemaphoreStore
258
258
~~~~~~~~~~~~~~
259
259
260
- The SemaphoreStore uses the PHP semaphore function to lock a ``resources ``.
260
+ The SemaphoreStore uses the PHP semaphore functions to lock a ``resources ``.
261
261
262
262
.. code-block :: php
263
263
0 commit comments