You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/source/async/advanced_configurations.rst
+35-1Lines changed: 35 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,9 +12,11 @@ if you need those middlewares, consider using a sync client or implement a new m
12
12
Clients
13
13
#######
14
14
15
-
as of now, we have two async client, ``AsyncDefaultClient``, available in ``django_valkey.async_cache.client.default``, and ``AsyncHerdClient`` available in ``django_valkey.async_cache.client.herd``.
15
+
We have three async client, ``AsyncDefaultClient``, available in ``django_valkey.async_cache.client.default``, ``AsyncHerdClient`` available in ``django_valkey.async_cache.client.herd`` and ``AsyncSentinelClient`` at ``django_valkey.async_cache.client.sentinel``.
16
16
the default client can also be used with sentinels, as we'll discuss later.
17
17
18
+
note that all clients are imported and available at ``django_valkey.async_cache.client``
19
+
18
20
Default client
19
21
^^^^^^^^^^^^^^
20
22
@@ -36,6 +38,38 @@ the ``AsyncDefaultClient`` is configured by default by ``AsyncValkeyCache``, so
36
38
37
39
or you can replace the client with your own like that.
38
40
41
+
Sentinel Client
42
+
^^^^^^^^^^^^^^^
43
+
44
+
to support sentinels, django_valkey comes with a client and a connection factory, technically you don't need the connection factory, but it provides you with some nice features.
45
+
a dedicated page on sentinel client has been written in :doc:`../configure/sentinel_configurations`, tho that is for the sync version, the principle is the same.
46
+
47
+
the connection factory is at ``django_valkey.async_cache.pool.AsyncSentinelConnectionFactory``.
48
+
49
+
to configure the async sentinel client you can write your settings like this:
50
+
51
+
.. code-block:: python
52
+
53
+
SENTINELS= [
54
+
("127.0.0.1", 26379), # a list of (host name, port) tuples.
*note*: the sentinel client uses the sentinel connection factory by default, you can change it by setting ``DJANGO_VALKEY_CONNECTION_FACTORY`` in your django settings or ``CONNECTION_FACTORY`` in your ``CACHES`` OPTIONS.
0 commit comments