Merge "Add 'requires_beating' property to coordination driver"

This commit is contained in:
Jenkins 2015-12-03 10:25:01 +00:00 committed by Gerrit Code Review
commit bbfe40bc26
3 changed files with 14 additions and 0 deletions

View File

@ -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)

View File

@ -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)

View File

@ -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)