diff --git a/pymesos/__init__.py b/pymesos/__init__.py index c5946f7..1b5f4ae 100644 --- a/pymesos/__init__.py +++ b/pymesos/__init__.py @@ -4,7 +4,7 @@ from .operator_v1 import MesosOperatorMasterDriver, MesosOperatorAgentDriver from .utils import encode_data, decode_data -__VERSION__ = '0.3.1' +__VERSION__ = '0.3.2' __all__ = ( 'Scheduler', diff --git a/pymesos/interface.py b/pymesos/interface.py index 43d1141..41c64ba 100644 --- a/pymesos/interface.py +++ b/pymesos/interface.py @@ -62,6 +62,11 @@ def disconnected(self, driver): the master fails and another is taking over. """ + def processHeartBeat(self): + """ + Invoked when the scheduler gets a heartbeat + """ + def resourceOffers(self, driver, offers): """ Invoked when resources have been offered to this framework. A single diff --git a/pymesos/scheduler.py b/pymesos/scheduler.py index 67682b2..91df5cf 100644 --- a/pymesos/scheduler.py +++ b/pymesos/scheduler.py @@ -607,10 +607,15 @@ def on_error(self, event): message = event['message'] self.sched.error(self, message) + def on_heartbeat(self): + self.sched.processHeartBeat() + def on_event(self, event): if 'type' in event: _type = event['type'].lower() + if _type == 'heartbeat': + self.on_heartbeat() return if _type not in event: