You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@buildstream.apache.org by no...@apache.org on 2020/12/29 12:31:04 UTC

[buildstream] 10/19: stream.py: Minimal implementation of event loop function

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 48847cdffdee48e8698011be6bdc1660eb08ae14
Author: Phil Dawson <ph...@codethink.co.uk>
AuthorDate: Thu Jun 20 11:12:57 2019 +0100

    stream.py: Minimal implementation of event loop function
---
 src/buildstream/_stream.py | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/src/buildstream/_stream.py b/src/buildstream/_stream.py
index 4a1edcf..e8b3931 100644
--- a/src/buildstream/_stream.py
+++ b/src/buildstream/_stream.py
@@ -1623,3 +1623,18 @@ class Stream():
         # subprocessed work has completed
 
         # Return result of subprocessed function
+
+    # The code to be run by the Stream's event loop while delegating
+    # work to a subprocess with the @subprocessed
+    def _loop(self):
+        assert self._notification_queue
+        # Check that the subprocessed work has not finished
+        # TODO
+
+        # Check for new messages
+        notification = self._notification_queue.get(block=True, timeout=0.1)
+
+        # Process new messages
+        if notification:
+            self._scheduler_notification_handler(notification)
+