code: def on_message(self, message):
          
          # Called in tornado loop
          try:
              self.log.debug("Got message %s", message)
              d = json_decode(message)
              response = deserialize_object(d, Response)
              if isinstance(response, (Return, Error)):
                  request = self._request_lookup.pop(response.id)
                  if isinstance(response, Error):
                      # Make the message an exception so it can be raised
                      response.message = ResponseError(response.message)
              else:
                  request = self._request_lookup[response.id]
              # Transfer the work of the callback to cothread
              cothread.Callback(request.callback, response)
          except Exception:
              # If we don't catch the exception here, tornado will spew odd
              # error messages about 'HTTPRequest' object has no attribute 'path'
              self.log.exception("on_message(%r) failed", message)
docs: Pass response from server to process receive queue
  
          Args:
              message(str): Received message