diff --git a/tooz/coordination.py b/tooz/coordination.py index 1664daf2..f452dc5e 100644 --- a/tooz/coordination.py +++ b/tooz/coordination.py @@ -64,6 +64,14 @@ class LeaderElected(Event): @six.add_metaclass(abc.ABCMeta) class CoordinationDriver(object): + requires_beating = False + """ + Usage requirement that if true requires that the :py:meth:`~.heartbeat` + be called periodically (at a given rate) to avoid locks, sessions and + other from being automatically closed/discarded by the coordinators + backing store. + """ + def __init__(self): self._started = False self._hooks_join_group = collections.defaultdict(Hooks) diff --git a/tooz/drivers/memcached.py b/tooz/drivers/memcached.py index ec83082e..e8eba589 100644 --- a/tooz/drivers/memcached.py +++ b/tooz/drivers/memcached.py @@ -145,6 +145,9 @@ class MemcachedDriver(coordination._RunWatchersMixin, #: String used to keep a key/member alive (until it next expires). STILL_ALIVE = b"It's alive!" + #: This driver requires constant periodic (heart) beatings. + requires_beating = True + def __init__(self, member_id, parsed_url, options): super(MemcachedDriver, self).__init__() options = utils.collapse(options) diff --git a/tooz/drivers/redis.py b/tooz/drivers/redis.py index 945a5739..3d5a3a11 100644 --- a/tooz/drivers/redis.py +++ b/tooz/drivers/redis.py @@ -286,6 +286,9 @@ return 1 .. _Lua: http://www.lua.org """ + #: This driver requires constant periodic (heart) beatings. + requires_beating = True + def __init__(self, member_id, parsed_url, options): super(RedisDriver, self).__init__() options = utils.collapse(options, exclude=self.CLIENT_LIST_ARGS)