Skip to content

Commit 8e5f28d

Browse files
committed
Merge branch '7.0' into 7.1
* 7.0: Improve the documentation about serializing lock keys
2 parents f479e01 + ee3895a commit 8e5f28d

File tree

1 file changed

+16
-18
lines changed

1 file changed

+16
-18
lines changed

components/lock.rst

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,10 @@ to handle the rest of the job::
105105

106106
use App\Lock\RefreshTaxonomy;
107107
use Symfony\Component\Lock\Key;
108-
use Symfony\Component\Lock\Lock;
109108

110109
$key = new Key('article.'.$article->getId());
111-
$lock = new Lock(
110+
$lock = $factory->createLockFromKey(
112111
$key,
113-
$this->store,
114112
300, // ttl
115113
false // autoRelease
116114
);
@@ -121,7 +119,7 @@ to handle the rest of the job::
121119
.. note::
122120

123121
Don't forget to set the ``autoRelease`` argument to ``false`` in the
124-
``Lock`` constructor to avoid releasing the lock when the destructor is
122+
``Lock`` instantiation to avoid releasing the lock when the destructor is
125123
called.
126124

127125
Not all stores are compatible with serialization and cross-process locking: for
@@ -388,20 +386,20 @@ Locks are created and managed in ``Stores``, which are classes that implement
388386

389387
The component includes the following built-in store types:
390388

391-
========================================================== ====== ======== ======== =======
392-
Store Scope Blocking Expiring Sharing
393-
========================================================== ====== ======== ======== =======
394-
:ref:`FlockStore <lock-store-flock>` local yes no yes
395-
:ref:`MemcachedStore <lock-store-memcached>` remote no yes no
396-
:ref:`MongoDbStore <lock-store-mongodb>` remote no yes no
397-
:ref:`PdoStore <lock-store-pdo>` remote no yes no
398-
:ref:`DoctrineDbalStore <lock-store-dbal>` remote no yes no
399-
:ref:`PostgreSqlStore <lock-store-pgsql>` remote yes no yes
400-
:ref:`DoctrineDbalPostgreSqlStore <lock-store-dbal-pgsql>` remote yes no yes
401-
:ref:`RedisStore <lock-store-redis>` remote no yes yes
402-
:ref:`SemaphoreStore <lock-store-semaphore>` local yes no no
403-
:ref:`ZookeeperStore <lock-store-zookeeper>` remote no no no
404-
========================================================== ====== ======== ======== =======
389+
========================================================== ====== ======== ======== ======= =============
390+
Store Scope Blocking Expiring Sharing Serialization
391+
========================================================== ====== ======== ======== ======= =============
392+
:ref:`FlockStore <lock-store-flock>` local yes no yes no
393+
:ref:`MemcachedStore <lock-store-memcached>` remote no yes no yes
394+
:ref:`MongoDbStore <lock-store-mongodb>` remote no yes no yes
395+
:ref:`PdoStore <lock-store-pdo>` remote no yes no yes
396+
:ref:`DoctrineDbalStore <lock-store-dbal>` remote no yes no yes
397+
:ref:`PostgreSqlStore <lock-store-pgsql>` remote yes no yes no
398+
:ref:`DoctrineDbalPostgreSqlStore <lock-store-dbal-pgsql>` remote yes no yes no
399+
:ref:`RedisStore <lock-store-redis>` remote no yes yes yes
400+
:ref:`SemaphoreStore <lock-store-semaphore>` local yes no no no
401+
:ref:`ZookeeperStore <lock-store-zookeeper>` remote no no no no
402+
========================================================== ====== ======== ======== ======= =============
405403

406404
.. tip::
407405

0 commit comments

Comments
 (0)