diff options
author | bst-marge-bot <marge-bot@buildstream.build> | 2020-08-23 20:16:11 +0000 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2020-08-23 20:16:11 +0000 |
commit | 41204fc7ebb26731c39600a0c0f1a9e5830e5812 (patch) | |
tree | 393d34206f48c28467840524de3f030804ae20b3 | |
parent | 00c5cd05ec8fe04d72affc42d399ac546d36b5b5 (diff) | |
parent | 433864ddcb0e8bf2d1036da00e3bd0c20463a950 (diff) | |
download | buildstream-41204fc7ebb26731c39600a0c0f1a9e5830e5812.tar.gz |
Merge branch 'bschubert/remove-custom-sched-messages' into 'master'
job.py: Remove 'SUBCLASS_CUSTOM_MESSAGE', it is never used
See merge request BuildStream/buildstream!2039
-rw-r--r-- | src/buildstream/_scheduler/jobs/job.py | 43 |
1 files changed, 0 insertions, 43 deletions
diff --git a/src/buildstream/_scheduler/jobs/job.py b/src/buildstream/_scheduler/jobs/job.py index 33aeebf29..fd4f7720d 100644 --- a/src/buildstream/_scheduler/jobs/job.py +++ b/src/buildstream/_scheduler/jobs/job.py @@ -76,7 +76,6 @@ class _MessageType(FastEnum): ERROR = 2 RESULT = 3 CHILD_DATA = 4 - SUBCLASS_CUSTOM_MESSAGE = 5 # Job() @@ -102,11 +101,6 @@ class _MessageType(FastEnum): # 3. Implement YourJob.create_child_job() and YourJob.parent_complete(). # 4. Implement YourChildJob.child_process(). # -# A Job instance and its ChildJob share a message pipe. You may send custom -# messages to the main process using YourChildJob.send_message(). Such messages -# must be processed in YourJob.handle_message(), which you will also need to -# override for this purpose. -# # Args: # scheduler (Scheduler): The scheduler # action_name (str): The queue action name @@ -332,22 +326,6 @@ class Job: # Abstract Methods # ####################################################### - # handle_message() - # - # Handle a custom message. This will be called in the main process in - # response to any messages sent to the main process using the - # Job.send_message() API from inside a Job.child_process() implementation. - # - # There is no need to implement this function if no custom messages are - # expected. - # - # Args: - # message (any): A simple object (must be pickle-able, i.e. strings, - # lists, dicts, numbers, but not Element instances). - # - def handle_message(self, message): - raise ImplError("Job '{kind}' does not implement handle_message()".format(kind=type(self).__name__)) - # parent_complete() # # This will be executed in the main process after the job finishes, and is @@ -483,8 +461,6 @@ class Job: elif envelope.message_type is _MessageType.CHILD_DATA: # If we retry a job, we assign a new value to this self.child_data = envelope.message - elif envelope.message_type is _MessageType.SUBCLASS_CUSTOM_MESSAGE: - self.handle_message(envelope.message) else: assert False, "Unhandled message type '{}': {}".format(envelope.message_type, envelope.message) @@ -596,25 +572,6 @@ class ChildJob: Message(message_type, message, element_name=element_name, element_key=element_key, **kwargs) ) - # send_message() - # - # Send data in a message to the parent Job, running in the main process. - # - # This allows for custom inter-process communication between subclasses of - # Job and ChildJob. - # - # These messages will be processed by the Job.handle_message() - # implementation, which may be overridden to support one or more custom - # 'message_type's. - # - # Args: - # message_data (any): A simple object (must be pickle-able, i.e. - # strings, lists, dicts, numbers, but not Element - # instances). This is sent to the parent Job. - # - def send_message(self, message_data): - self._send_message(_MessageType.SUBCLASS_CUSTOM_MESSAGE, message_data) - ####################################################### # Abstract Methods # ####################################################### |