October 2018
Beginner to intermediate
736 pages
17h 39m
English
Initially, the Dispatcher, if it were an independent process and not folded into the Orchestrator, would be concerned with dispatch result operations only:
DISPATCH_OPERATIONS = namedtuple(
'DISPATCH_OPERATIONS', ['dispatch_results',]
)(
dispatch_results='dispatch_results',
)
Its _handle_message method would be constructed accordingly:
def _handle_message(self, message:(DaemonMessage,)) -> None: self.info( '%s._handle_message called:' % self.__class__.__name__ ) # ... if message.operation == DISPATCH_OPERATIONS.dispatch_results: self.dispatch_results(message) else: raise RuntimeError( '%s error: "%s" (%s) is not a recognized ' 'operation' % ( self.__class__.__name__, message.operation, type(message.operation).__name__ ) ) ...