summaryrefslogtreecommitdiff
path: root/docs/connections.rst
diff options
context:
space:
mode:
authorChayim <chayim@users.noreply.github.com>2021-12-30 12:52:11 +0200
committerGitHub <noreply@github.com>2021-12-30 12:52:11 +0200
commitbc3dbb45d7236f96d614c33684a94f3e0fd9ac4a (patch)
tree5da61d39c34e3ad558be7c78c9f54c185084968e /docs/connections.rst
parentdeaaa536568e50b6ce958de0dd6306392e98f13e (diff)
downloadredis-py-bc3dbb45d7236f96d614c33684a94f3e0fd9ac4a.tar.gz
Documentation cleanup (#1841)
Diffstat (limited to 'docs/connections.rst')
-rw-r--r--docs/connections.rst35
1 files changed, 33 insertions, 2 deletions
diff --git a/docs/connections.rst b/docs/connections.rst
index 973821b..cf4657b 100644
--- a/docs/connections.rst
+++ b/docs/connections.rst
@@ -3,10 +3,41 @@ Connecting to Redis
Generic Client
**************
-.. autoclass:: redis.client.Redis
+
+This is the client used to connect directly to a standard redis node.
+
+.. autoclass:: redis.Redis
+ :members:
+
+Sentinel Client
+***************
+
+Redis `Sentinel <https://redis.io/topics/sentinel>`_ provides high availability for Redis. There are commands that can only be executed against a redis node running in sentinel mode. Connecting to those nodes, and executing commands against them requires a Sentinel connection.
+
+Connection example (assumes redis redis on the ports listed below):
+
+ >>> from redis import Sentinel
+ >>> sentinel = Sentinel([('localhost', 26379)], socket_timeout=0.1)
+ >>> sentinel.discover_master('mymaster')
+ ('127.0.0.1', 6379)
+ >>> sentinel.discover_slaves('mymaster')
+ [('127.0.0.1', 6380)]
+
+.. autoclass:: redis.sentinel.Sentinel
+ :members:
+
+.. autoclass:: redis.sentinel.SentinelConnectionPool
+ :members:
+
+Cluster Client
+**************
+
+This client is used for connecting to a redis cluser.
+
+.. autoclass:: redis.cluster.RedisCluster
:members:
Connection Pools
*****************
.. autoclass:: redis.connection.ConnectionPool
- :members: \ No newline at end of file
+ :members: