An Avro message.

It contains the various types used to send it (request, error, response).
8351
function Message(name, attrs, opts) {
  opts = opts || {};

  if (!types.isValidName(name)) {
    throw new Error(f('invalid message name: %s', name));
  }
  this._name = name;

  var recordName = f('org.apache.avro.ipc.%sRequest', name);
  this._requestType = types.createType({
    name: recordName,
    type: 'record',
    namespace: opts.namespace || '', // Don't leak request namespace.
    fields: attrs.request
  }, opts);
  // We remove the record from the registry to prevent it from being exported
  // in the protocol's schema.
  delete opts.registry[recordName];

  if (!attrs.response) {
    throw new Error('missing response');
  }
  this._responseType = types.createType(attrs.response, opts);

  var errors = attrs.errors || [];
  errors.unshift('string');
  this._errorType = types.createType(errors, opts);

  this._oneWay = !!attrs['one-way'];
  if (this._oneWay) {
    if (this._responseType.getTypeName() !== 'null' || errors.length > 1) {
      throw new Error('unapplicable one-way parameter');
    }
  }
}
142135
def types():
        
        if Message._types is None:
            Message._types = {}
            classes_to_process = [Message]
            while classes_to_process:
                atom = classes_to_process.pop()
                classes_to_process += atom.__subclasses__()
                Message._types[atom.__name__] = atom
        return Message._types
765514
function(message) {
  return {
    length: message.readInt32LE(0),
    requestId: message.readInt32LE(4),
    responseTo: message.readInt32LE(8),
    opCode: message.readInt32LE(12)
  };
}
866561
def __pack_message(operation, data):
    
    request_id = random.randint(-2 ** 31 - 1, 2 ** 31)
    message = struct.pack("<i", 16 + len(data))
    message += struct.pack("<i", request_id)
    message += __ZERO  # responseTo
    message += struct.pack("<i", operation)
    return (request_id, message + data)
1256394
def _request(self, msg_type, msg_data=None):
    """"""
    msg = {}
    msg['type'] = msg_type
    if msg_data:
      msg['data'] = msg_data

    done = False
    tries = 0
    while not done and tries < MAX_RETRIES:
      try:
        MessageSocket.send(self, self.sock, msg)
        done = True
      except socket.error as e:
        tries += 1
        if tries >= MAX_RETRIES:
          raise
        print("Socket error: {}".format(e))
        self.sock.close()
        self.sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        self.sock.connect(self.server_addr)

    logging.debug("sent: {0}".format(msg))
    resp = MessageSocket.receive(self, self.sock)
    logging.debug("received: {0}".format(resp))
    return resp
1267173
def assign_message_type_values(values)
      values.each do |key, value|
        public_send(key, value) if respond_to?(key)
      end
    end
1115093
def response_message(cls, result, request_id):
        ''''''
        if isinstance(result, CodeMessageError):
            payload = cls.error_payload(result, request_id)
        else:
            payload = cls.response_payload(result, request_id)
        return cls.encode_payload(payload)
927571
async def message(request):
    

    msg = request.get('msg')
    if msg is None:
        return request.text("To send a message, go to 0.0.0.0:8000/"
                            "message/?msg='insert message here'.")
    await app.webhook.send(msg)
    return response.text("Send.")
838660
public function to_avro()
  {
    $avro = array("protocol" => $this->name, "namespace" => $this->namespace);
    
    if (!is_null($this->doc))
      $avro["doc"] = $this->doc;
    
    $types = array();
    $avro["types"] = $this->schemata->to_avro();
    
    $messages = array();
    foreach ($this->messages as $name => $msg)
      $messages[$name] = $msg->to_avro();
    $avro["messages"] = $messages;
    
    return $avro;
  }
265861
function(messageType, params) {
			// check valid messageType
			var message = messageType + F2.stringify(params);
			jQuery.each(_apps, function(i, a) {
				a.socket.postMessage(message);
			});
		}
996662
function transport(message) {
    return {
      header: message.header,
      request: message.request,
      response: message.response
    }
  }
1190451
async def dump_message(self, msg, msg_type=None):
        
        mtype = msg.__class__ if msg_type is None else msg_type
        fields = mtype.f_specs()
        for field in fields:
            await self.message_field(msg=msg, field=field)
745179
def message(self, message: types.Message):
        
        setattr(self, 'from_chat_id', message.chat.id)
        setattr(self, 'message_id', message.message_id)
        return self
665219
function Message(type, contents) {
  if (false === (this instanceof Message)) throw new Error('new operator required');
  if ('undefined' == typeof type) throw new Error('message type required');
  if (!contains(Message.getTypes(), type)) throw new Error('Invalid message type: ' + type);
  this.type = type;
  this.contents = contents;
}
244505
function logMessage(messageType, message) {
  if (Object.values(messageTypes).includes(messageType)) {
    console[messageType](message)
  } else {
    console.info(message)
  }
}
793827
def message(message)
      reqdata = reqdata()
      reqdata.merge!({
        :nick => @endpoint[:nick],
        :type => "chat",
        :style => "",
        :timestamp => Time.now.to_f * 1000
      })
      reqdata.merge!(message)
      httpost('/messages', reqdata)
    end
1205594
def _process_messages(self, messages, ignore_unknown_message_types=False):
        
        with self.before_after_send_handling():
            for message_id, message_data in messages.items():
                message_model, dispatch_models = message_data
                try:
                    message_cls = get_registered_message_type(message_model.cls)
                except UnknownMessageTypeError:
                    if ignore_unknown_message_types:
                        continue
                    raise

                message_type_cache = None
                for dispatch in dispatch_models:
                    if not dispatch.message_cache:  # Create actual message text for further usage.
                        try:
                            if message_type_cache is None and not message_cls.has_dynamic_context:
                                # If a message class doesn't depend upon a dispatch data for message compilation,
                                # we'd compile a message just once.
                                message_type_cache = message_cls.compile(message_model, self, dispatch=dispatch)

                            dispatch.message_cache = message_type_cache or message_cls.compile(
                                message_model, self, dispatch=dispatch)

                        except Exception as e:
                            self.mark_error(dispatch, e, message_cls)

                self.send(message_cls, message_model, dispatch_models)