def dequeue(self): msg = self.read() if msg: command = registry.get_command_for_message(msg) command.execute() return msg
def put(self, message): command = registry.get_command_for_message(message) command.execute()