If there are any message in the queue, process one of them.
497220
def _process_queue(self):
        '''
        
        '''
        if len(self._queue):
            args, kwargs = self._queue.popleft()
            self.publish(*args, **kwargs)
991625
async def handle(self, msg: Any) -> Any:
        
        res = self.handleSync(msg)
        if isawaitable(res):
            return await res
        else:
            return res
79459
def process(self):
        
        assert self.queue is not None
        while True:
            event = self.queue.get()
            if self.pre_process_event(event):
                self.invoke_handlers(event)
            self.queue.task_done()
1220592
@Override
    public void processMessage(AbsSender absSender, Message message, String[] arguments) {
        execute(absSender, message.getFrom(), message.getChat(), message.getMessageId(), arguments);
    }
435948
private void _processInboxMessages(JSONArray messages) {
        synchronized (inboxControllerLock) {
            if (this.ctInboxController == null) {
                _initializeInbox();
            }
            if (this.ctInboxController != null) {
                boolean update = this.ctInboxController.updateMessages(messages);
                if (update) {
                    _notifyInboxMessagesDidUpdate();
                }
            }
        }
    }
501279
def process_queue #:nodoc:
      messages_come = false
      @connections.each do |connection|
        while not connection.msg_queue.empty?
          msg = connection.msg_queue.pop
          messages_come = true
          if @callback
            @callback.call(msg)
          end
        end
      end
      messages_come
    end
982142
def process_send_message_outcome(line)
      outcome = SendMessageOutcomeMessage.parse line
      return unless outcome

      @mutex.synchronize do
        @callbacks[:on_message_result].each do |callback|
          callback.call outcome.sequence, outcome.numbers, outcome.error
        end
      end

      true
    end
1313228
public void handleIncomingMessage(byte[] data, int offset, int len) {
		synchronized(messageQueue) {
			messageQueue.add(new IncomingMessage(data, offset, len));
		}
		synchronized(lock) {
			lock.notifyAll();
		}
	}
962589
def _process_queue_message(self, message_queue, new_queue_found, batch_exit,
                               start_time, timeout, batch_timeout):
        """"""

        for queue in self._filter_queues([message_queue]):
            if queue not in self._queue_set:
                if not new_queue_found:
                    new_queue_found = True
                    batch_exit = time.time() + batch_timeout
                    # Limit batch_exit to max timeout
                    if batch_exit > start_time + timeout:
                        batch_exit = start_time + timeout
                self._queue_set.add(queue)
                self.log.debug('new queue', queue=queue)

        return new_queue_found, batch_exit
279971
@Override
	public void processMessage( Message message ) {

		if( message instanceof MsgNotifMachineDown )
			processMsgNotifMachineDown((MsgNotifMachineDown) message );

		else if( message instanceof MsgNotifInstanceChanged )
			processMsgNotifInstanceChanged((MsgNotifInstanceChanged) message );

		else if( message instanceof MsgNotifInstanceRemoved )
			processMsgNotifInstanceRemoved((MsgNotifInstanceRemoved) message );

		else if( message instanceof MsgNotifHeartbeat )
			processMsgNotifHeartbeat((MsgNotifHeartbeat) message );

		else if(message instanceof MsgNotifAutonomic)
			processMsgMonitoringEvent((MsgNotifAutonomic) message );

		else if( message instanceof MsgEcho )
			this.manager.debugMngr().notifyMsgEchoReceived((MsgEcho) message );

		else if( message instanceof MsgNotifLogs )
			processMsgNotifLogs((MsgNotifLogs) message );

		else
			this.logger.warning( "The DM got an undetermined message to process: " + message.getClass().getName());
	}
191384
def ProcessMessage(self, message):
    """"""
    self.ProcessResponse(message.source.Basename(), message.payload)
255453
public function process()
    {
        if (!$this->io->inReadQueue()) {
            return;
        }

        $line = $this->handleMessage($this->io->pop());
        if ($line) {
            $this->io->push($line);
            $this->io->write();
        }

        $this->bot->removeConnection($this);
        $this->disconnect();
    }
229033
def run(self):
        """"""
        while not self.stopped:
            try:
                # grab a message from queue
                message = self.gc100_client.queue.get(True, 5)
            except queue.Empty:
                _LOGGER.debug("message thread: no messages")
                continue

            _LOGGER.debug("message thread: " + str(message))

            # parse message
            split_message = str(message).split(',')
            if len(split_message) != 3:
                _LOGGER.error("can't parse server response")
                continue
            event, module_address, value = str(message).split(',')
            value = int(value)

            # make a copy of the current subscribers to keep this thread-safe
            current_subscribers = dict(self.gc100_client.subscribers)

            # send message to subscribers
            for subscriber_id in current_subscribers:
                # msg or op should match what we asked for
                subscriber = current_subscribers[subscriber_id]

                if event + "," + module_address == subscriber['event']:
                    subscriber['callback'](value)
                    if subscriber['permanent'] is False:
                        self.gc100_client.unsubscribe(subscriber_id)

            # signals to queue job is done
            self.gc100_client.queue.task_done()
316181
def done(message):
    """"""

    def done(value, _context, **_params):
        return Done(value, message)

    return done
325572
def QueueResponse(self, message, blocking=True):
    """"""
    self._out_queue.Put(message, block=blocking)
260707
def Process(self, fs_msg, context):
    """"""
    try:
      if fs_msg.message_type == "GrrMessage":
        grr_message = rdf_flows.GrrMessage.FromSerializedString(
            fs_msg.data.value)
        self._ProcessGRRMessages(fs_msg.source.client_id, [grr_message])
      elif fs_msg.message_type == "MessageList":
        packed_messages = rdf_flows.PackedMessageList.FromSerializedString(
            fs_msg.data.value)
        message_list = communicator.Communicator.DecompressMessageList(
            packed_messages)
        self._ProcessGRRMessages(fs_msg.source.client_id, message_list.job)
      else:
        logging.error("Received message with unrecognized message_type: %s",
                      fs_msg.message_type)
        context.set_code(grpc.StatusCode.INVALID_ARGUMENT)
    except Exception as e:
      logging.error("Exception processing message: %s", str(e))
      raise
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)