Commit c786b19c authored by S. Lackner's avatar S. Lackner

[sched] Add hook for received messages

parent ccb3d969
......@@ -143,7 +143,9 @@ class BaseBatsimScheduler(BatsimScheduler):
job=jobobj,
message=message,
type="job_message_received")
jobobj.messages.append(Message(timestamp, message))
msg = Message(timestamp, message)
jobobj.messages.append(msg)
self._scheduler.on_job_message(jobobj, msg)
self._scheduler._do_schedule()
def onMachinePStateChanged(self, nodeid, pstate):
......@@ -519,6 +521,15 @@ class Scheduler(metaclass=ABCMeta):
"""
pass
def on_job_message(self, job, message):
"""Hook similar to the low-level API.
:param job: the sending job
:param message: the sent message
"""
pass
def on_machine_pstate_changed(self, resource, pstate):
"""Hook similar to the low-level API.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment