Processes incoming messages according to engine-io rules
489288
def on_message(self, new_data):
        """"""
        # https://github.com/socketio/engine.io-protocol

        LOGGER.debug("new frame [%r]", new_data)
        try:
            what = int(new_data[0])
            data = new_data[1:]
            data = data and from_json(data)
            if what == 0:
                self.ping_interval = float(data["pingInterval"]) / 1000
                LOGGER.debug("adjusted ping interval")
                return

            if what == 1:
                LOGGER.debug("received close")
                self.reraise(IOError("Connection closed remotely"))
                return

            if what == 3:
                self.__lastpong = time.time()
                LOGGER.debug("received a pong")
                return

            if what == 4:
                self._on_frame(data)
                return

            if what == 6:
                LOGGER.debug("received noop")
                self.send_message("5")
                return

            LOGGER.debug("unhandled message: [%d] [%r]", what, data)
        except Exception as ex:
            self.reraise(ex)
829108
def ProcessMessage(self, message):
    """"""
    # Only accept authenticated messages
    if (message.auth_state !=
        rdf_flows.GrrMessage.AuthorizationState.AUTHENTICATED):
      return

    now = time.time()

    # Maintain a cache of the foreman
    with self.lock:
      if (self.foreman_cache is None or
          now > self.foreman_cache.age + self.cache_refresh_time):
        self.foreman_cache = aff4.FACTORY.Open(
            "aff4:/foreman", mode="rw", token=self.token)
        self.foreman_cache.age = now

    if message.source:
      self.foreman_cache.AssignTasksToClient(message.source.Basename())
949370
async def on_process_message(self, message: types.Message, data: dict):
        
        # Get current handler
        handler = current_handler.get()

        # Get dispatcher from context
        dispatcher = Dispatcher.get_current()
        # If handler was configured, get rate limit and key from handler
        if handler:
            limit = getattr(handler, 'throttling_rate_limit', self.rate_limit)
            key = getattr(handler, 'throttling_key', f"{self.prefix}_{handler.__name__}")
        else:
            limit = self.rate_limit
            key = f"{self.prefix}_message"

        # Use Dispatcher.throttle method.
        try:
            await dispatcher.throttle(key, rate=limit)
        except Throttled as t:
            # Execute action
            await self.message_throttled(message, t)

            # Cancel current handler
            raise CancelHandler()
27471
def pipe_to_process(self, payload):
        """"""
        message = payload['input']
        key = payload['key']
        if not self.process_handler.is_running(key):
            return {'message': 'No running process for this key',
                    'status': 'error'}
        self.process_handler.send_to_process(message, key)
        return {'message': 'Message sent',
                'status': 'success'}
660064
public void runHandler(OrtcClient sender, String channel, String message, Object filtered, Object payload){
		if(this.withOptions){
            Map msgOptions = new HashMap();
            msgOptions.put("channel", channel);
            msgOptions.put("message", message);
			if (payload instanceof String){
            	msgOptions.put("seqId", ((String) payload));
			}else if (payload instanceof Map){
				msgOptions.put("seqId", (String)((Map) payload).get("seqId"));
			}
            if (filtered != null){
                msgOptions.put("filter", ((Boolean) filtered).booleanValue());
            }
            this.onMessageWithOptions.run(sender, msgOptions);
		} else if(this.withFilter){
            this.onMessageWithFilter.run(sender, channel, (Boolean) filtered, message);
        } else if(this.isWithPayload){
            this.onMessageWithPayload.run(sender, channel, message, (Map)payload);
        } else{
			this.onMessage.run(sender, channel, message);
		}
	}
158450
function process(message) {
  for (var i = 0; i < modifiers.length; i++) {
    message = modifiers[i].apply(modifiers[i], arguments);
  }

  return message;
}
520108
function onMessage(message) {
  if (message.command === 'run') {
    run(message.opts);
    return;
  }

  if (message.command === 'stop') {
    cleanup();
  }
}
191384
def ProcessMessage(self, message):
    """"""
    self.ProcessResponse(message.source.Basename(), message.payload)
776168
async def _process_message(self, message):
        
        self._pending_ack.add(message.msg_id)
        handler = self._handlers.get(message.obj.CONSTRUCTOR_ID,
                                     self._handle_update)
        await handler(message)
781064
public void engineReloaded(Object objectSent) {

    	final JsMessagingEngine engine = (JsMessagingEngine)objectSent;
    	
        final String methodName = "engineReloaded";
        if (TRACE.isEntryEnabled()) {
            SibTr.entry(this, TRACE, methodName, engine);
        }

        RELOADING_MESSAGING_ENGINES.remove(engine.getUuid().toString());

        // Get listeners to notify
        final Set listeners = getListeners(engine.getBusName());

        // Notify listeners
        for (final Iterator iterator = listeners.iterator(); iterator.hasNext();) {

            final SibRaMessagingEngineListener listener = (SibRaMessagingEngineListener) iterator
                    .next();
            listener.messagingEngineReloaded(engine);

        }

        if (TRACE.isEntryEnabled()) {
            SibTr.exit(this, TRACE, methodName);
        }

    }
1361017
public void messagingEngineReloaded(final JsMessagingEngine engine) {

        final String methodName = "messagingEngineReloaded";
        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.entry(this, TRACE, methodName, engine);
        }

        boolean engineStarted = false;
        // Get all the active ME's that are on the same bus as the reloaded ME
        JsMessagingEngine[] engines = SibRaEngineComponent.getActiveMessagingEngines(engine.getBusName());

        for (int i = 0; i < engines.length; i++)
        {
          // Now check if the reloaded ME is part of the active ME's (i.e. a started ME
          if (engines[i].equals(engine))
          {
            //It is active so lets mark the engine as started
            engineStarted = true;
            break;
          }
        }

        // Only do this logic on a started engine. If the engine isn't started then when
        // the start is called we will do the same logic of trying to create a listener,
        // so there is no need to wait here till it starts.
        if (engineStarted)
        {
          try
          {

            /*
             * If there is not already a connection to the messaging engine and
             * a listener is still required given the new configuration, create
             * one now
             */

            if (!_connections.containsKey(engine.getUuid().toString())
                    && isListenerRequired(engine)) {

                createListener(engine);

            }

          }
          catch (final ResourceException exception)
          {

            // No FFDC code needed

            if (TraceComponent.isAnyTracingEnabled() && TRACE.isEventEnabled()) {
                SibTr.exception(this, TRACE, exception);
            }

            SibTr.error(TRACE, "RELOAD_FAILED_CWSIV0773", new Object[] {
                    exception, engine.getName(), engine.getBusName(), this });

          }
        } // end of if(engineStarted)

        if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) {
            SibTr.exit(this, TRACE, methodName);
        }

    }
953068
function processInputStream(msg) {
      var tmp = msg.payload;

      if ('string' === typeof msg.payload) {
        msg.payload = JSON.parse(tmp);
      }
      if (msg.payload.action) {
        if ('start' === msg.payload.action) {
          startPacket = msg.payload;
        }
      } else {
        msg.payload = { 'action' : 'data', 'data' : tmp };
      }

      return Promise.resolve(msg.payload);
    }
628629
def _process_info_message(self, message):
        """"""
        # Extract the output resolution from the appropriate message, if
        # it's present.
        if message['messageCode'] == 'JOB_RUNNING_RESOLUTION':
            self._resolution = message['contents']['resolutionMs']
        elif message['messageCode'] == 'FETCH_NUM_TIMESERIES':
            self._num_input_timeseries += int(message['numInputTimeSeries'])
331053
function postMessageToNode(messageId) {
        var msg = {
            fn: messageId,
            args: getFunctionArgs(arguments),
            requester: domainID
        };
        updateDomain.exec('data', msg);
    }
1312532
private void processMessages(int idx) {
        LOG.finest("Processing thread " + idx + " starting...");
        try {
            HTTPExchange exch;
            do {
                exch = nextExchange(idx);
                if (exch == null) {
                    break;
                }

                // Test hook to manipulate what the client sees:
                ExchangeInterceptor interceptor = exchInterceptor.get();
                if (interceptor != null) {
                    HTTPExchange newExch = interceptor.interceptExchange(exch);
                    if (newExch == null) {
                        LOG.log(Level.FINE, "Discarding exchange on request "
                                + "of test hook: RID="
                                + exch.getRequest().getAttribute(
                                    Attributes.RID));
                        lock.lock();
                        try {
                            exchanges.remove(exch);
                        } finally {
                            lock.unlock();
                        }
                        continue;
                    }
                    exch = newExch;
                }

                processExchange(idx, exch);
            } while (true);
        } finally {
            LOG.log(Level.FINEST, "Processing thread exiting: " + idx);
        }

    }
711799
def process_initialization_message(message)
      entry = @connection.objects.convert_properties_to_object(message.entry)
      @connection.remote_entry.set(entry)
    end
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