Skip to content

[Cache][Lock] Add support for Relay\Cluster in docs #21009

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 29, 2025
Merged
Show file tree
Hide file tree
Changes from all 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
32 changes: 30 additions & 2 deletions components/cache/adapters/redis_adapter.rst
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ to utilize a cluster of servers to provide redundancy and/or fail-over is also a

**Requirements:** At least one `Redis server`_ must be installed and running to use this
adapter. Additionally, this adapter requires a compatible extension or library that implements
``\Redis``, ``\RedisArray``, ``RedisCluster``, ``\Relay\Relay`` or ``\Predis``.
``\Redis``, ``\RedisArray``, ``RedisCluster``, ``\Relay\Relay``, ``\Relay\Cluster`` or ``\Predis``.

This adapter expects a `Redis`_, `RedisArray`_, `RedisCluster`_, `Relay`_ or `Predis`_ instance to be
This adapter expects a `Redis`_, `RedisArray`_, `RedisCluster`_, `Relay`_, `RelayCluster`_ or `Predis`_ instance to be
passed as the first parameter. A namespace and default cache lifetime can optionally be passed
as the second and third parameters::

Expand All @@ -48,6 +48,10 @@ as the second and third parameters::
?MarshallerInterface $marshaller = null
);

.. versionadded:: 7.3

Support for ``Relay\Cluster`` was introduced in Symfony 7.3.

Configure the Connection
------------------------

Expand Down Expand Up @@ -226,11 +230,34 @@ Available Options
``ssl`` (type: ``array``, default: ``null``)
SSL context options. See `php.net/context.ssl`_ for more information.

``relay_cluster_context`` (type: ``array``, default: ``[]``)
Defines configuration options specific to ``\Relay\Cluster``. For example, to
user a self-signed certificate for testing in local environment::

$options = [
// ...
'relay_cluster_context' => [
// ...
'stream' => [
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true,
'local_cert' => '/valkey.crt',
'local_pk' => '/valkey.key',
'cafile' => '/valkey.crt',
],
],
];

.. versionadded:: 7.1

The option ``sentinel_master`` as an alias for ``redis_sentinel`` was introduced
in Symfony 7.1.

.. versionadded:: 7.3

The ``relay_cluster_context`` option was introduced in Symfony 7.3.

.. note::

When using the `Predis`_ library some additional Predis-specific options are available.
Expand Down Expand Up @@ -359,6 +386,7 @@ Supports key rotation, ensuring secure decryption with both old and new keys::
.. _`RedisArray`: https://github.com/phpredis/phpredis/blob/develop/arrays.md
.. _`RedisCluster`: https://github.com/phpredis/phpredis/blob/develop/cluster.md
.. _`Relay`: https://relay.so/
.. _`RelayCluster`: https://relay.so/docs/1.x/connections#cluster
.. _`Predis`: https://packagist.org/packages/predis/predis
.. _`Predis Connection Parameters`: https://github.com/nrk/predis/wiki/Connection-Parameters#list-of-connection-parameters
.. _`TCP-keepalive`: https://redis.io/topics/clients#tcp-keepalive
Expand Down
10 changes: 7 additions & 3 deletions components/lock.rst
Original file line number Diff line number Diff line change
Expand Up @@ -612,9 +612,9 @@ RedisStore
~~~~~~~~~~

The RedisStore saves locks on a Redis server, it requires a Redis connection
implementing the ``\Redis``, ``\RedisArray``, ``\RedisCluster``, ``\Relay\Relay`` or
``\Predis`` classes. This store does not support blocking, and expects a TTL to
avoid stalled locks::
implementing the ``\Redis``, ``\RedisArray``, ``\RedisCluster``, ``\Relay\Relay``,
``\Relay\Cluster`` or ``\Predis`` classes. This store does not support blocking,
and expects a TTL to avoid stalled locks::

use Symfony\Component\Lock\Store\RedisStore;

Expand All @@ -623,6 +623,10 @@ avoid stalled locks::

$store = new RedisStore($redis);

.. versionadded:: 7.3

Support for ``Relay\Cluster`` was introduced in Symfony 7.3.

.. _lock-store-semaphore:

SemaphoreStore
Expand Down
Loading