/* type message handler
19755
function (args, callback) {
        ternserver.request({
            query: {
              type: "type",  //$NON-NLS-1$
              file: args.meta.location,
              end: args.params.offset
            }
          },
          function (error, type) {
            if (error) {
              callback({
                request: 'type',
                error: typeof error === 'string' ? error : error.message,
                message: Messages['failedType']
              }); //$NON-NLS-1$
            } else {
              callback({request: 'type', type: type}); //$NON-NLS-1$
            }
          });
      }
458373
private void handleRequest(final ChannelHandlerContext ctx, final ByteBuf message) {
    if (isDataMessage(message)) {
      dataEventHandler.onEvent(flowController, message);
    } else if (isControlMessage(message)) {
      controlHandler.onEvent(flowController, message);
    } else if (DcpNoopRequest.is(message)) {
      try {
        ByteBuf buffer = ctx.alloc().buffer();
        DcpNoopResponse.init(buffer);
        MessageUtil.setOpaque(MessageUtil.getOpaque(message), buffer);
        ctx.writeAndFlush(buffer);
      } finally {
        message.release();
      }
    } else {
      try {
        LOGGER.warn("Unknown DCP Message, ignoring. \n{}", MessageUtil.humanize(message));
      } finally {
        message.release();
      }
    }
  }
164877
function nodeInputHandler(msg) {
            log.verbose(`[${uibInstance}] nodeGo:nodeInputHandler - emit received msg - Namespace: ${node.url}`) //debug

            // If msg is null, nothing will be sent
            if ( msg !== null ) {
                // if msg isn't null and isn't an object
                // NOTE: This is paranoid and shouldn't be possible!
                if ( typeof msg !== 'object' ) {
                    // Force msg to be an object with payload of original msg
                    msg = { 'payload': msg }
                }
                // Add topic from node config if present and not present in msg
                if ( !(msg.hasOwnProperty('topic')) || msg.topic === '' ) {
                    if ( node.topic !== '' ) msg.topic = node.topic
                    else msg.topic = 'uibuilder'
                }
            }

            // Keep this fn small for readability so offload
            // any further, more customised code to another fn
            msg = uiblib.inputHandler(msg, node, RED, io, ioNs, log)

        }
1166967
function handleIncomingMessage(data) {
		var message;
		reader.parse(data, initPending);
		initPending = false;
		while (!reader.isEmpty()) {
			message = reader.pop();
			// console.log("IN MESSAGE: " + inspect(message));
			handlers[message.verb](message);
		}
	}
922417
async def message_handler(self, event):
        """"""

        # Note that message_handler is called when a Telegram update occurs
        # and an event is created. Telegram may not always send information
        # about the ``.sender`` or the ``.chat``, so if you *really* want it
        # you should use ``get_chat()`` and ``get_sender()`` while working
        # with events. Since they are methods, you know they may make an API
        # call, which can be expensive.
        chat = await event.get_chat()
        if event.is_group:
            if event.out:
                sprint('>> sent "{}" to chat {}'.format(
                    event.text, get_display_name(chat)
                ))
            else:
                sprint('<< {} @ {} sent "{}"'.format(
                    get_display_name(await event.get_sender()),
                    get_display_name(chat),
                    event.text
                ))
        else:
            if event.out:
                sprint('>> "{}" to user {}'.format(
                    event.text, get_display_name(chat)
                ))
            else:
                sprint('<< {} sent "{}"'.format(
                    get_display_name(chat), event.text
                ))
255079
function (message) {
    var that = this;
    that._traceLogEventsCount();
    that.mc.trigger(TypeMsg$1.OnCreateError, message);
  }
1184435
function EventHandlerError (status, info, id, msg){
        console.log ("#%d- Notice Info=%s Data=%s Id=%s Msg:%s", count, status, info, id, msg );
    }
1262089
function handleMessage(message) {
  var type = message.data.type;
  var id = message.data.id;
  var payload = message.data.payload;
  switch(type) {
    case 'load-index':
      makeRequest(SEARCH_TERMS_URL, function(searchInfo) {
        index = createIndex(loadIndex(searchInfo));
        self.postMessage({type: type, id: id, payload: true});
      });
      break;
    case 'query-index':
      self.postMessage({type: type, id: id, payload: {query: payload, results: queryIndex(payload)}});
      break;
    default:
      self.postMessage({type: type, id: id, payload: {error: 'invalid message type'}})
  }
}
364466
def on_message(self, con, event):
        """"""
        msg_type = event.getType()
        nick = event.getFrom().getResource()
        from_jid = event.getFrom().getStripped()
        body = event.getBody()

        if msg_type == 'chat' and body is None:
            return

        logger.debug('msg_type[%s] from[%s] nick[%s] body[%s]' % (msg_type, from_jid, nick, body,))

        sender = filter(lambda m: m['JID'] == from_jid, self.params['MEMBERS'])

        should_process = msg_type in ['message', 'chat', None] and body is not None and len(sender) == 1
        if not should_process: return
        sender = sender[0]

        try:
            for p in self.command_patterns:
                reg, cmd = p
                m = reg.match(body)
                if m:
                    logger.info('pattern matched for bot command \'%s\'' % (cmd,))
                    function = getattr(self, str(cmd), None)
                    if function:
                        return function(sender, body, m)

            words = body.split(' ')
            cmd, args = words[0], words[1:]
            if cmd and cmd[0] == '/':
                cmd = cmd[1:]
                command_handler = getattr(self, 'do_'+cmd, None)
                if command_handler:
                    return command_handler(sender, body, args)

            broadcast_body = '[%s] %s' % (sender['NICK'], body,)
            return self.broadcast(broadcast_body, exclude=(sender,))
        except:
            logger.exception('Error handling message [%s] from [%s]' % (body, sender['JID']))
1051080
def is_message_handler(type_, from_, cb):
    

    try:
        handlers = aioxmpp.service.get_magic_attr(cb)
    except AttributeError:
        return False

    return aioxmpp.service.HandlerSpec(
        (_apply_message_handler, (type_, from_)),
        require_deps=(
            SimpleMessageDispatcher,
        )
    ) in handlers
914304
@Override
    public String handleEventMessage(String msg, Object msgdoc,
            Map<String, String> metainfo) throws EventHandlerException {
        return null;
    }
265861
function(messageType, params) {
			// check valid messageType
			var message = messageType + F2.stringify(params);
			jQuery.each(_apps, function(i, a) {
				a.socket.postMessage(message);
			});
		}
347749
private void handleCommandCallback(final String message) {
		// JSON callback
        final JSONObject jsonObject = new JSONObject(message);
		final String eventType = jsonObject.getString("event");

		final CommandCallbackHandler commandCallbackHandler = commandCallbacks.get(eventType);
		if( commandCallbackHandler == null ) {
			logger.error("Unknown event: {}", message);
			return;
		}
		try {
			commandCallbackHandler.handleChannelData(jsonObject);
		} catch (final BitfinexClientException e) {
			logger.error("Got an exception while handling callback");
		}
	}
831033
function(element, type, handler) {
    var types = type.split(' ');
    Utils.each(types, function(type){
      element.addEventListener(type, handler, false);
    });
  }
610241
void triggerBasicEvent(Event.EventType type, String message)
  {
    triggerBasicEvent(type, message, false);
  }
1003268
function onPreRequestHandler (ctx, err) {
  let m = ctx._encoderPipeline.run(ctx._message, ctx);

  // encoding issue
  if (m.error) {
    let error = new Errors.ParseError(Constants.PAYLOAD_PARSING_ERROR).causedBy(m.error);
    ctx.log.error(error);
    ctx.emit('clientResponseError', error);

    ctx._execute(error);
    return;
  }

  if (err) {
    let error = null;
    if (err instanceof SuperError) {
      error = err.rootCause || err.cause || err;
    } else {
      error = err;
    }

    const internalError = new Errors.MostlyError(Constants.EXTENSION_ERROR).causedBy(err);
    ctx.log.error(internalError);

    ctx.emit('clientResponseError', error);

    ctx._execute(error);
    return;
  }

  ctx._request.payload = m.value;
  ctx._request.error = m.error;

  // use simple publish mechanism instead of request/reply
  if (ctx._pattern.pubsub$ === true) {
    if (ctx._actCallback) {
      ctx.log.info(Constants.PUB_CALLBACK_REDUNDANT);
    }

    ctx._transport.send(ctx._pattern.topic, ctx._request.payload);
  } else {
    const optOptions = {};
    // limit on the number of responses the requestor may receive
    if (ctx._pattern.maxMessages$ > 0) {
      optOptions.max = ctx._pattern.maxMessages$;
    } else if (ctx._pattern.maxMessages$ !== -1) {
      optOptions.max = 1;
    } // else unlimited messages

    // send request
    ctx._sid = ctx._transport.sendRequest(ctx._pattern.topic,
      ctx._request.payload, optOptions, ctx._sendRequestHandler.bind(ctx));

    // handle timeout
    ctx.handleTimeout();
  }
}
483856
private static void handleRemainingCharIfAny(final String messagePattern, final int len,
            final StringBuilder buffer, final int escapeCounter, final int i) {
        if (i == len - 1) {
            final char curChar = messagePattern.charAt(i);
            handleLastChar(buffer, escapeCounter, curChar);
        }
    }