diff options
author | Benjamin Schubert <contact@benschubert.me> | 2020-07-04 17:45:36 +0000 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2020-07-06 18:07:53 +0000 |
commit | 598345c76510bc703e3f488a5fd8c0b1170509e3 (patch) | |
tree | ba478aed13a72cdcdf45e1b20d4be17e8aede05c /src/buildstream/_stream.py | |
parent | 7dd880048ce6eaf8fe6d49b8dfa84bfd5629bc12 (diff) | |
download | buildstream-598345c76510bc703e3f488a5fd8c0b1170509e3.tar.gz |
_stream.py: Stop using a 'RUNNING' event to know the state of the scheduler
The stream is itself calling the `run` method on the scheduler, we don't
need another indirection
Diffstat (limited to 'src/buildstream/_stream.py')
-rw-r--r-- | src/buildstream/_stream.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/buildstream/_stream.py b/src/buildstream/_stream.py index 9a00ecdc0..7c8baf233 100644 --- a/src/buildstream/_stream.py +++ b/src/buildstream/_stream.py @@ -100,7 +100,7 @@ class Stream: self._ticker_callback = ticker_callback self._interrupt_callback = interrupt_callback self._notifier = self._scheduler._stream_notification_handler # Assign the schedulers notification handler - self._scheduler_running = False + self._running = False self._terminated = False self._suspended = False @@ -1062,7 +1062,7 @@ class Stream: # @property def running(self): - return self._scheduler_running + return self._running # suspended # @@ -1377,7 +1377,9 @@ class Stream: if self._session_start_callback is not None: self._session_start_callback() + self._running = True status = self._scheduler.run(self.queues, self._context.get_cascache().get_casd_process_manager()) + self._running = False if status == SchedStatus.ERROR: raise StreamError() @@ -1654,8 +1656,6 @@ class Stream: self._interrupt_callback() elif notification.notification_type == NotificationType.TICK: self._ticker_callback() - elif notification.notification_type == NotificationType.RUNNING: - self._scheduler_running = not self._scheduler_running else: raise StreamError("Unrecognised notification type received: {}".format(notification.notification_type)) |