This is an automated email from the ASF dual-hosted git repository. not-in-ldap pushed a commit to branch phil/ui-split-refactor in repository https://gitbox.apache.org/repos/asf/buildstream.git
commit ed0eabe3ccac556f5ebe3783cb8538bba5ab0f16 Author: Tom Pollard <[email protected]> AuthorDate: Tue Jun 18 13:02:15 2019 +0100 Refer to stream-scheduler communication as notifications --- src/buildstream/_scheduler/scheduler.py | 38 ++++++++++++++++----------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/src/buildstream/_scheduler/scheduler.py b/src/buildstream/_scheduler/scheduler.py index 5bf0764..9e120e4 100644 --- a/src/buildstream/_scheduler/scheduler.py +++ b/src/buildstream/_scheduler/scheduler.py @@ -98,7 +98,7 @@ class Notification: class Scheduler(): def __init__(self, context, - start_time, state, message_handler, + start_time, state, notification_handler, interrupt_callback=None, ticker_callback=None, interactive_failure=False): @@ -131,8 +131,8 @@ class Scheduler(): self._cleanup_scheduled = False # Whether we have a cleanup job scheduled self._cleanup_running = None # A running CleanupJob, or None - # Callback to send messages to report back to the Scheduler's owner - self.message = message_handler + # Callback to send notifications to report back to the Scheduler's owner + self.notify = notification_handler # Whether our exclusive jobs, like 'cleanup' are currently already # waiting or active. @@ -299,13 +299,13 @@ class Scheduler(): # this may change if the frontend is run in a separate process for pickling element = job._element if (job.element_job and self._interactive_failure) else None - message = Notification(NotificationType.JOB_COMPLETE, - full_name=job.name, - job_action=job.action_name, - job_status=status, - failed_element=job.element_job, - element=element) - self.message(message) + notification = Notification(NotificationType.JOB_COMPLETE, + full_name=job.name, + job_action=job.action_name, + job_status=status, + failed_element=job.element_job, + element=element) + self.notify(notification) if process_jobs: # Now check for more jobs @@ -365,11 +365,11 @@ class Scheduler(): # def _start_job(self, job): self._active_jobs.append(job) - message = Notification(NotificationType.JOB_START, - full_name=job.name, - job_action=job.action_name, - elapsed_time=self.elapsed_time()) - self.message(message) + notification = Notification(NotificationType.JOB_START, + full_name=job.name, + job_action=job.action_name, + elapsed_time=self.elapsed_time()) + self.notify(notification) job.start() # Callback for the cache size job @@ -588,8 +588,8 @@ class Scheduler(): if self.terminated: return - message = Notification(NotificationType.INTERRUPT) - self.message(message) + notification = Notification(NotificationType.INTERRUPT) + self.notify(notification) # _terminate_event(): # @@ -648,8 +648,8 @@ class Scheduler(): # Regular timeout for driving status in the UI def _tick(self): - message = Notification(NotificationType.TICK) - self.message(message) + notification = Notification(NotificationType.TICK) + self.notify(notification) self.loop.call_later(1, self._tick) def __getstate__(self):
