summaryrefslogtreecommitdiff
path: root/src/buildstream/_stream.py
diff options
context:
space:
mode:
authorBenjamin Schubert <contact@benschubert.me>2020-07-04 18:05:21 +0000
committerbst-marge-bot <marge-bot@buildstream.build>2020-07-06 18:07:53 +0000
commit61dd3d603d66bd8e92e87060e1d46993c71badf3 (patch)
treeed64d285b589de8f39b879595f5c82b8b377f2fd /src/buildstream/_stream.py
parent598345c76510bc703e3f488a5fd8c0b1170509e3 (diff)
downloadbuildstream-61dd3d603d66bd8e92e87060e1d46993c71badf3.tar.gz
scheduler.py: Remove notifications from scheduler to stream
This removes all notifications left coming from the scheduler, and replaces them by callbacks
Diffstat (limited to 'src/buildstream/_stream.py')
-rw-r--r--src/buildstream/_stream.py16
1 files changed, 1 insertions, 15 deletions
diff --git a/src/buildstream/_stream.py b/src/buildstream/_stream.py
index 7c8baf233..b8f42f582 100644
--- a/src/buildstream/_stream.py
+++ b/src/buildstream/_stream.py
@@ -94,11 +94,9 @@ class Stream:
context.messenger.set_state(self._state)
self._scheduler = Scheduler(
- context, session_start, self._state, self._notification_queue, self._scheduler_notification_handler
+ context, session_start, self._state, self._notification_queue, interrupt_callback, ticker_callback
)
self._session_start_callback = session_start_callback
- self._ticker_callback = ticker_callback
- self._interrupt_callback = interrupt_callback
self._notifier = self._scheduler._stream_notification_handler # Assign the schedulers notification handler
self._running = False
self._terminated = False
@@ -1647,18 +1645,6 @@ class Stream:
return element_targets, artifact_refs
- def _scheduler_notification_handler(self):
- # Check the queue is there
- assert self._notification_queue
- notification = self._notification_queue.pop()
-
- if notification.notification_type == NotificationType.INTERRUPT:
- self._interrupt_callback()
- elif notification.notification_type == NotificationType.TICK:
- self._ticker_callback()
- else:
- raise StreamError("Unrecognised notification type received: {}".format(notification.notification_type))
-
def _notify(self, notification):
# Stream to scheduler notifcations on left side
self._notification_queue.appendleft(notification)