Executes an HTTP request to create message on the queue.
        Creates queue if not existed.

        Arguments:
        messages -- An array of messages to be added to the queue.
5506
def post(self, *messages):
        
        url = "queues/%s/messages" % self.name

        msgs = [{'body': msg} if isinstance(msg, basestring) else msg
                for msg in messages]
        data = json.dumps({'messages': msgs})

        result = self.client.post(url=url, body=data,
                                  headers={'Content-Type': 'application/json'})

        return result['body']
1231039
def call(message, captures, arguments)
      bargs = captures + arguments

      thread = Thread.new {
        @bot.loggers.debug "[New thread] For #{self}: #{Thread.current} -- #{@thread_group.list.size} in total."

        begin
          if @execute_in_callback
            @bot.callback.instance_exec(message, *@args, *bargs, &@block)
          else
            @block.call(message, *@args, *bargs)
          end
        rescue => e
          @bot.loggers.exception(e)
        ensure
          @bot.loggers.debug "[Thread done] For #{self}: #{Thread.current} -- #{@thread_group.list.size - 1} remaining."
        end
      }

      @thread_group.add(thread)
      thread
    end
998002
def new_message(self, body=''):
        
        m = self.message_class(self, body)
        m.queue = self
        return m
356046
@Override
    public Message createMessage(Session session) throws JMSException {
        Message message = session.createTextMessage(requestMessage);
        if (correlationId != null)
            message.setJMSCorrelationID(correlationId);
        if (replyQueue != null) {
            message.setJMSReplyTo(replyQueue);
        }
        if (delaySeconds >0) {
            ApplicationContext.getJmsProvider().setMessageDelay(null, message, delaySeconds);
        }
        return message;
    }
625295
async def send_message(
        self, request: str, response_expected: bool, **kwargs: Any
    ) -> Response:
        
        await self.socket.send(request)
        if response_expected:
            response_text = await self.socket.recv()
            return Response(response_text)
        return Response("")
222213
public void onMessage(Message msg) {
	        try {
                    LOG.debug("Queuing msg [" + msg.getJMSMessageID() + "]");
                } catch (JMSException e) {
                }
		this.queue.offer(msg);
	}
1249753
def _update_message_request(self, message):
        
        for each in self.row_keys:
            message.rows.row_keys.append(_to_bytes(each))

        for each in self.row_ranges:
            r_kwrags = each.get_range_kwargs()
            message.rows.row_ranges.add(**r_kwrags)
1019481
def new_message(cls, from_user, to_users, subject, content):
        
        thread = Thread.objects.create(subject=subject)
        for user in to_users:
            thread.userthread_set.create(user=user, deleted=False, unread=True)
        thread.userthread_set.create(user=from_user, deleted=True, unread=False)
        msg = cls.objects.create(thread=thread, sender=from_user, content=content)
        message_sent.send(sender=cls, message=msg, thread=thread, reply=False)
        return msg
1031151
def create
			@message = Message.new(message_params)

			if @message.valid?
				MessageMailer.message_me(@message).deliver_now
				redirect_to new_message_path, notice: "Thank you for your message."
			else
				render :new
			end
		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)
433359
def message_create(self, originator, recipients, body, params=None):
        """"""
        if params is None: params = {}
        if type(recipients) == list:
            recipients = ','.join(recipients)

        params.update({'originator': originator, 'body': body, 'recipients': recipients})
        return Message().load(self.request('messages', 'POST', params))
512672
def run(self, *, delay=None):
        
        self.broker.enqueue(self.messages[0], delay=delay)
        return self
848852
def add_messages(self, messages):
        
        # remove old messages
        if len(messages) > self.limit:
            messages = messages[:self.limit]
        _logger(self.__class__).log(5, 'adding %s messages' % len(messages))
        self._finished = False
        self._new_messages = messages
        self._to_check = list(self._messages)
        self._pending_msg = messages
        # start removing messages, new message won't be added until we
        # checked all message that need to be removed
        QtCore.QTimer.singleShot(1, self._remove_batch)
306831
def add(self, message):
        
        if not isinstance(message, ValidationMessage):
            raise TypeError("Argument must of type ValidationMessage")
        self.messages.append(message)
549310
def handle(self, message):
        '''
        
        '''

        logger.debug(message)
        if Utilities.isNotEmpty(message['metadata']['opts']):
            target = message['metadata']['opts']['target']
            self.botThread.create_message(target, message['text'])
742206
def queue(self, queue, message, params={}, uids=[]):
        
        d = {
            'id': uuid.uuid1().get_hex(),
            'version': 1,
            'message': message,
            'params': params
        }

        if uids:
            for uid in uids:
                yield self.client.lpush('rhumba.dq.%s.%s' % (
                    uid, queue), json.dumps(d))
        else:
            yield self.client.lpush('rhumba.q.%s' % queue, json.dumps(d))

        defer.returnValue(d['id'])
2798
def add(self, level, message, extra_tags='', *args, **kwargs):
        
        if not message:
            return
            # Check that the message level is not less than the recording level.
        level = int(level)
        if level < self.level:
            return
            # Add the message.
        self.added_new = True
        message = Message(level, message, extra_tags=extra_tags)
        message = self.process_message(message, *args, **kwargs)
        if message:
            self._queued_messages.append(message)