summaryrefslogtreecommitdiff
path: root/src/buildstream/_messenger.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/buildstream/_messenger.py')
-rw-r--r--src/buildstream/_messenger.py43
1 files changed, 0 insertions, 43 deletions
diff --git a/src/buildstream/_messenger.py b/src/buildstream/_messenger.py
index 03b2833ec..3a32a2467 100644
--- a/src/buildstream/_messenger.py
+++ b/src/buildstream/_messenger.py
@@ -375,49 +375,6 @@ class Messenger:
self._log_handle.write("{}\n".format(text))
self._log_handle.flush()
- # get_state_for_child_job_pickling(self)
- #
- # Return data necessary to reconstruct this object in a child job process.
- #
- # This should be implemented the same as __getstate__(). We define this
- # method instead as it is child job specific.
- #
- # Returns:
- # (dict): This `state` is what we want `self.__dict__` to be restored to
- # after instantiation in the child process.
- #
- def get_state_for_child_job_pickling(self):
- state = self.__dict__.copy()
-
- # When pickling a Messenger over to the ChildJob, we don't want to bring
- # the whole _message_handler over with it. We also don't want to remove it
- # in the main process. If we remove it in the child process then we will
- # already be too late. The only time that seems just right is here, when
- # preparing the child process' copy of the Messenger.
- #
- # Another approach might be to use a context manager on the Messenger,
- # which removes and restores the _message_handler. This wouldn't require
- # access to private details of Messenger, but it would open up a window
- # where messagesw wouldn't be handled as expected.
- #
- del state["_message_handler"]
-
- # The render status callback is only used in the main process
- #
- del state["_render_status_cb"]
-
- # The "simple_task" context manager is not needed outside the main
- # process. During testing we override it to something that cannot
- # pickle, so just drop it when pickling to a child job. Note that it
- # will only appear in 'state' if it has been overridden.
- #
- state.pop("simple_task", None)
-
- # The State object is not needed outside the main process
- del state["_state"]
-
- return state
-
# _render_status()
#
# Calls the render status callback set in the messenger, but only if a