diff options
author | Angelos Evripiotis <jevripiotis@bloomberg.net> | 2019-07-02 17:14:44 +0100 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2019-07-05 09:44:45 +0000 |
commit | cfbab5fe76f8011bc8b6b895b2d3bfff4ea167b3 (patch) | |
tree | 51abb49a04c9797e7def9c8929e8f427037c61ed /src/buildstream/_scheduler | |
parent | b60fffebf563edfe258cbb893754197af1ac5a0b (diff) | |
download | buildstream-cfbab5fe76f8011bc8b6b895b2d3bfff4ea167b3.tar.gz |
Refactor, use context.messenger directly
Instead of having methods in Context forward calls on to the Messenger,
have folks call the Messenger directly. Remove the forwarding methods in
Context.
Diffstat (limited to 'src/buildstream/_scheduler')
-rw-r--r-- | src/buildstream/_scheduler/jobs/job.py | 10 | ||||
-rw-r--r-- | src/buildstream/_scheduler/queues/queue.py | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/buildstream/_scheduler/jobs/job.py b/src/buildstream/_scheduler/jobs/job.py index e970481ab..00e4a0c10 100644 --- a/src/buildstream/_scheduler/jobs/job.py +++ b/src/buildstream/_scheduler/jobs/job.py @@ -347,7 +347,7 @@ class Job(): if "unique_id" in kwargs: unique_id = kwargs["unique_id"] del kwargs["unique_id"] - self._scheduler.context.message( + self._scheduler.context.messenger.message( Message(unique_id, message_type, message, **kwargs)) ####################################################### @@ -470,7 +470,7 @@ class Job(): if envelope.message_type is _MessageType.LOG_MESSAGE: # Propagate received messages from children # back through the context. - self._scheduler.context.message(envelope.message) + self._scheduler.context.messenger.message(envelope.message) elif envelope.message_type is _MessageType.ERROR: # For regression tests only, save the last error domain / reason # reported from a child task in the main process, this global state @@ -592,7 +592,7 @@ class ChildJob(): if "unique_id" in kwargs: unique_id = kwargs["unique_id"] del kwargs["unique_id"] - self._context.message( + self._context.messenger.message( Message(unique_id, message_type, message, **kwargs)) # send_message() @@ -673,7 +673,7 @@ class ChildJob(): # Set the global message handler in this child # process to forward messages to the parent process self._queue = queue - self._context.set_message_handler(self._child_message_handler) + self._context.messenger.set_message_handler(self._child_message_handler) starttime = datetime.datetime.now() stopped_time = None @@ -690,7 +690,7 @@ class ChildJob(): # Time, log and and run the action function # with _signals.suspendable(stop_time, resume_time), \ - self._context.recorded_messages(self._logfile) as filename: + self._context.messenger.recorded_messages(self._logfile, self._context.logdir) as filename: self.message(MessageType.START, self.action_name, logfile=filename) diff --git a/src/buildstream/_scheduler/queues/queue.py b/src/buildstream/_scheduler/queues/queue.py index f2cefd5d2..49a5381c1 100644 --- a/src/buildstream/_scheduler/queues/queue.py +++ b/src/buildstream/_scheduler/queues/queue.py @@ -332,7 +332,7 @@ class Queue(): def _message(self, element, message_type, brief, **kwargs): context = element._get_context() message = Message(element._unique_id, message_type, brief, **kwargs) - context.message(message) + context.messenger.message(message) def _element_log_path(self, element): project = element._get_project() |