Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[Lock] Add DynamoDbStore#20944

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
natepage wants to merge1 commit intosymfony:7.3
base:7.3
Choose a base branch
Loading
fromnatepage:feature/lock-add-dynamodb-store
Open
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 28 additions & 0 deletionscomponents/lock.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -399,6 +399,7 @@
:ref:`RedisStore <lock-store-redis>` remote no yes yes yes
:ref:`SemaphoreStore <lock-store-semaphore>` local yes no no no
:ref:`ZookeeperStore <lock-store-zookeeper>` remote no no no no
:ref:`DynamoDbStore <lock-store-dynamodb>` remote no yes no yes
========================================================== ====== ======== ======== ======= =============

.. tip::
Expand DownExpand Up@@ -698,6 +699,32 @@
Zookeeper does not require a TTL as the nodes used for locking are ephemeral
and die when the PHP process is terminated.

.. _lock-store-dynamodb:

DynamoDbStore
~~~~~~~~~~~~~

The DynamoDbStore saves locks on a Amazon DynamoDB table. Install it by running:

.. code-block:: terminal

$ composer require symfony/amazon-dynamodb-lock

It requires a `DynamoDbClient`_ instance or a `Data Source Name (DSN)`_.
This store does not support blocking, and expects a TTL to avoid stalled locks::

use Symfony\Component\Lock\Bridge\DynamoDb\Store\DynamoDbStore;

Check failure on line 716 in components/lock.rst

View workflow job for this annotation

GitHub Actions/ Code Blocks

[Missing class] Class, interface or trait with name "Symfony\Component\Lock\Bridge\DynamoDb\Store\DynamoDbStore" does not exist

// a DynamoDbClient instance or DSN
$dynamoDbClientOrDSN = 'dynamodb://default/lock';
$store = new DynamoDbStore($dynamoDbClientOrDSN);

The table where values are stored is created automatically on the first call to
the :method:`Symfony\\Component\\Lock\\Bridge\\DynamoDb\\DynamoDbStore::save` method.
You can also create this table explicitly by calling the
:method:`Symfony\\Component\\Lock\\Bridge\\DynamoDb\\DynamoDbStore::createTable` method in
your code.

Reliability
-----------

Expand DownExpand Up@@ -1049,3 +1076,4 @@
.. _`readers-writer lock`: https://en.wikipedia.org/wiki/Readers%E2%80%93writer_lock
.. _`priority policy`: https://en.wikipedia.org/wiki/Readers%E2%80%93writer_lock#Priority_policies
.. _`PCNTL`: https://www.php.net/manual/book.pcntl.php
.. _`DynamoDbClient`: https://async-aws.com/clients/dynamodb.html
4 changes: 4 additions & 0 deletionslock.rst
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -61,6 +61,7 @@ this behavior by using the ``lock`` key like:
lock: 'sqlsrv:server=127.0.0.1;Database=app'
lock: 'oci:host=127.0.0.1;dbname=app'
lock: 'mongodb://127.0.0.1/app?collection=lock'
lock: 'dynamodb://127.0.0.1/lock'
lock: '%env(LOCK_DSN)%'
# using an existing service
lock: 'snc_redis.default'
Expand DownExpand Up@@ -119,6 +120,8 @@ this behavior by using the ``lock`` key like:

<framework:resource>mongodb://127.0.0.1/app?collection=lock</framework:resource>

<framework:resource>dynamodb://127.0.0.1/lock</framework:resource>

<framework:resource>%env(LOCK_DSN)%</framework:resource>

<!-- using an existing service -->
Expand DownExpand Up@@ -157,6 +160,7 @@ this behavior by using the ``lock`` key like:
->resource('default', ['sqlsrv:server=127.0.0.1;Database=app'])
->resource('default', ['oci:host=127.0.0.1;dbname=app'])
->resource('default', ['mongodb://127.0.0.1/app?collection=lock'])
->resource('default', ['dynamodb://127.0.0.1/lock'])
->resource('default', [env('LOCK_DSN')])
// using an existing service
->resource('default', ['snc_redis.default'])
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp