Skip to content

Commit

Permalink
Added Redis SentinelChannel to reference docs
Browse files Browse the repository at this point in the history
  • Loading branch information
matusvalo committed Sep 23, 2020
1 parent 56e88dc commit f475285
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
7 changes: 7 additions & 0 deletions docs/reference/kombu.transport.redis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,10 @@
.. autoclass:: Channel
:members:
:undoc-members:

SentinelChannel
---------------

.. autoclass:: SentinelChannel
:members:
:undoc-members:
18 changes: 15 additions & 3 deletions kombu/transport/redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -1091,16 +1091,28 @@ class SentinelChannel(Channel):
Broker url is supposed to look like:
sentinel://0.0.0.0:26379;sentinel://0.0.0.0:26380/...
.. code-block::
sentinel://0.0.0.0:26379;sentinel://0.0.0.0:26380/...
where each sentinel is separated by a `;`.
Other arguments for the sentinel should come from the transport options
(see :method:`Celery.connection` which is in charge of creating the
`Connection` object).
(see `transport_options` of :class:`~kombu.connection.Connection`).
You must provide at least one option in Transport options:
* `master_name` - name of the redis group to poll
Example:
.. code-block:: python
>>> import kombu
>>> c = kombu.Connection(
'sentinel://sentinel1:26379;sentinel://sentinel2:26379',
transport_options={'master_name': 'mymaster'}
)
>>> c.connect()
"""

from_transport_options = Channel.from_transport_options + (
Expand Down

0 comments on commit f475285

Please sign in to comment.