celery_redis_sentinel.backend module¶
-
class
celery_redis_sentinel.backend.
RedisSentinelBackend
(transport_options=None, *args, **kwargs)[source]¶ Bases:
celery.backends.redis.RedisBackend
Redis results backend with support for Redis Sentinel
Note
In order to correctly configure the sentinel, this backend expects an additional backend celery configuration to be present -
CELERY_RESULT_BACKEND_TRANSPORT_OPTIONS
. Here is are sample transport options:CELERY_RESULT_BACKEND_TRANSPORT_OPTIONS = { 'sentinels': [('192.168.1.1', 26379), ('192.168.1.2', 26379), ('192.168.1.3', 26379)], 'service_name': 'master', 'socket_timeout': 0.1, }
-
client
[source]¶ Cached property for getting
Redis
client to be used to interact with redis.Returned client also subclasses from
EnsuredRedisMixin
which ensures that all redis commands are executed with retry logic in case of sentinel failover.Returns: Redis client connected to Sentinel via Sentinel connection pool Return type: Redis
-