@@ -105,12 +105,10 @@ to handle the rest of the job::
105
105
106
106
use App\Lock\RefreshTaxonomy;
107
107
use Symfony\Component\Lock\Key;
108
- use Symfony\Component\Lock\Lock;
109
108
110
109
$key = new Key('article.'.$article->getId());
111
- $lock = new Lock (
110
+ $lock = $factory->createLockFromKey (
112
111
$key,
113
- $this->store,
114
112
300, // ttl
115
113
false // autoRelease
116
114
);
@@ -121,7 +119,7 @@ to handle the rest of the job::
121
119
.. note ::
122
120
123
121
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
125
123
called.
126
124
127
125
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
388
386
389
387
The component includes the following built-in store types:
390
388
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
+ ========================================================== ====== ======== ======== ======= =============
405
403
406
404
.. tip ::
407
405
0 commit comments