Skip to content

Commit d1d3b71

Browse files
javiereguiluzjderusse
authored andcommitted
Fixed minor typos and syntax issues
1 parent 60bfe03 commit d1d3b71

File tree

1 file changed

+11
-18
lines changed

1 file changed

+11
-18
lines changed

components/lock.rst

Lines changed: 11 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ infinitely.
9898

9999
To fill this gap, the remote ``Stores`` provide an expirable mechanism: The lock
100100
is acquired for a defined amount of time (named TTL for Time To Live).
101-
When the timeout occured, the lock is automatically released even if the locker
101+
When the timeout occurred, the lock is automatically released even if the locker
102102
don't call the ``release()`` method.
103103

104104
That's why, when you create a lock on an expirable ``Store``. You have to choose
@@ -126,13 +126,13 @@ the ``resource`` will stay lock till the timeout.
126126
.. tip::
127127

128128
To avoid letting the Lock in a locking state, try to always release an
129-
expirable lock by wraping the job in a try/catch block for instance.
129+
expirable lock by wrapping the job in a try/catch block for instance.
130130

131131
When you have to work on a really long task, you should not set the TTL to
132132
overlap the duration of this task. Instead, the Lock Component expose a
133133
:method:`Symfony\\Component\\Lock\\LockInterface::refresh` method in order to
134134
put off the TTL of the Lock. Thereby you can choose a small initial TTL, and
135-
regulary refresh the lock
135+
regularly refresh the lock
136136

137137
.. code-block:: php
138138
@@ -145,7 +145,7 @@ regulary refresh the lock
145145
$lock->acquire();
146146
try {
147147
while (!$finished) {
148-
// perfom a small part of the job.
148+
// perform a small part of the job.
149149
150150
$lock->refresh();
151151
// resource is locked for 30 more seconds.
@@ -186,10 +186,8 @@ FlockStore
186186
~~~~~~~~~~
187187

188188
The FlockStore use the fileSystem on the local computer to lock and store the
189-
``resource``.
190-
It does not supports expiration, but the lock is automaticaly released when the
191-
PHP process is terminated.
192-
189+
``resource``. It does not supports expiration, but the lock is automatically
190+
released when the PHP process is terminated.
193191

194192
.. code-block:: php
195193
@@ -206,7 +204,6 @@ file will be created.
206204
We suggest to use local file, or to use a Store dedicated to remote usage
207205
like Redis or Memcached.
208206

209-
210207
.. _Packagist: https://packagist.org/packages/symfony/lock
211208

212209
.. _lock-store-memcached:
@@ -221,7 +218,6 @@ The MemcachedStore stores state of ``resource`` in a Memcached server. This
221218

222219
Memcached does not supports TTL lower than 1 seconds.
223220

224-
225221
It requires to have installed Memcached and have created a connection that
226222
implements the ``\Memcached`` classes::
227223

@@ -263,7 +259,6 @@ SemaphoreStore
263259

264260
The SemaphoreStore uses the PHP semaphore function to lock a ``resources``.
265261

266-
267262
.. code-block:: php
268263
269264
use Symfony\Component\Lock\Store\SemaphoreStore;
@@ -276,14 +271,14 @@ CombinedStore
276271
~~~~~~~~~~~~~
277272

278273
The CombinedStore synchronize several ``Stores`` together. When it's used to
279-
acquired a Lock, it forward the call to the managed ``Stores``, and regarding the
280-
result, uses a quorum to decide whether or not the lock is acquired.
274+
acquired a Lock, it forwards the call to the managed ``Stores``, and regarding
275+
the result, uses a quorum to decide whether or not the lock is acquired.
281276

282277
.. note::
283278

284-
This ``Store`` is usefull for High availability application. You can provide
279+
This ``Store`` is useful for High availability application. You can provide
285280
several Redis Server, and use theses server to manage the Lock. A
286-
MajorityQuorum is enougth to safely acquire a lock while it allow some Redis
281+
MajorityQuorum is enough to safely acquire a lock while it allow some Redis
287282
server failure.
288283

289284
.. code-block:: php
@@ -293,7 +288,7 @@ result, uses a quorum to decide whether or not the lock is acquired.
293288
use Symfony\Component\Lock\Store\RedisStore;
294289
295290
$stores = [];
296-
foreach (['server1', 'server2', 'server3'] as $server) {
291+
foreach (array('server1', 'server2', 'server3') as $server) {
297292
$redis= new \Redis();
298293
$redis->connect($server);
299294
@@ -302,12 +297,10 @@ result, uses a quorum to decide whether or not the lock is acquired.
302297
303298
$store = new CombinedStore($stores, new MajorityQuorum());
304299
305-
306300
.. tip::
307301

308302
You can use the CombinedStore with the UnanimousQuorum to implement chained
309303
``Stores``. It'll allow you to acquire easy local locks before asking for a
310304
remote lock
311305

312-
313306
.. _Packagist: https://packagist.org/packages/symfony/lock

0 commit comments

Comments
 (0)