ON MESSAGE // 
FUNCTION: onMessage( msg )
Callback invoked upon receiving a message from the parent process.

@param {*} msg - message
184947
function onMessage( msg ) {
	// TODO: log
	if ( msg !== null ) {
		if ( msg.opts ) {
			topical.publish( 'opts', msg.opts );
		}
		if ( msg.body ) {
			topical.publish( 'body', msg.body );
		}
	}
	run();
}
657322
function(message) {
            $log
              .append( settings.templates.message(message) )
            ;
            module.message.scroll.test();
            $.proxy(settings.onMessage, $log.children().last() )();
          }
378664
@Override
    public void onMessage(String channel, Message message) {
        if (MessageUtil.isMessageExcluded(message, RecipientType.CONSUMER, nodeId)) {
            return;
        }
        
        if (updateDelivered(message)) {
            LinkedHashSet<IMessageCallback> callbacks = getCallbacks(channel, false, true);
            
            if (callbacks != null) {
                dispatchMessages(channel, message, callbacks);
            }
        }
    }
341853
function _onMessage(message) {
        var response    = JSON.parse(message.data),
            msgRecord   = _messageCallbacks[response.id],
            callback    = msgRecord && msgRecord.callback,
            msgText     = (msgRecord && msgRecord.message) || "No message";

        if (msgRecord) {
            // Messages with an ID are a response to a command, fire callback
            callback(response.result, response.error);
            delete _messageCallbacks[response.id];
        } else if (response.method) {
            // Messages with a method are an event, trigger event handlers
            var domainAndMethod = response.method.split("."),
                domain = domainAndMethod[0],
                method = domainAndMethod[1];

            EventDispatcher.triggerWithArray(exports[domain], method, response.params);
        }

        // Always fire event handlers for all messages/errors
        exports.trigger("message", response);

        if (response.error) {
            exports.trigger("error", response.error, msgText);
        }
    }
839057
def _on_read(self, sender, *args, **kwargs):
        
        data = kwargs.get('data', None)
        self.on_read(data=data)

        self._handle_message(data)
1297980
function sendHelperMessage(msg) {
  var port = chrome.runtime.connect({ name: 'popup' });
  port.postMessage(msg);
  port.onMessage.addListener(function (response) {
    console.log('Got response message: ', response);
  });
}
984003
@Override
    public void handleMessage(Message msg) {
        if (msg.what == ASYNC) {
            mAsyncDispatcher.dispatch();
        } else if (msg.what == SYNC) {
            mSyncDispatcher.dispatch();
        } else super.handleMessage(msg);
    }
501484
public void processMessage (Message msg)
    {
        if (_client.getRunQueue().isRunning()) {
            // append it to our queue
            _actions.append(msg);
            // and queue ourselves up to be run
            _client.getRunQueue().postRunnable(this);
        } else {
            log.info("Dropping message as RunQueue is shutdown", "msg", msg);
        }
    }
958587
function onmessage(channel, message) {
  if(closing) {
    return;
  }

  switch(channel) {
    case ChannelConstants.syncChannel:
      module.exports.emit('sync', message);
      break;
    case ChannelConstants.lockRequestChannel:
      module.exports.emit('lock-request', message);
      break;
    case ChannelConstants.lockResponseChannel:
      module.exports.emit('lock-response', message);
      break;
    default:
      log.warn('[Redis] Got unexpected message on channel `%s`. Message was: `%s`', channel, message);
      break;
  }
}
1033716
function onPeerMessage(peer,msg)
    {
        scope.dispatchEvent("peerMessage",{message:msg,id:peer.id,rtc:peer.rtcId,array:false,fallback:false});
    }
1019443
function onMessage(message) {
    if (done) return
    if (message.type != "utf8") return sendConnectFailed(wsConn)

    try {
      message = JSON.parse(message.utf8Data)
    }
    catch(err) {
      return sendConnectFailed(wsConn)
    }

    var id  = message.id

    if (message.type != "request") return sendConnectFailed(wsConn)
    if (message.name != "connect") return sendConnectFailed(wsConn)
    if (message.to   != "server") return sendConnectFailed(wsConn)

    var body = message.body || {}

    if (!body.key) return sendConnectFailed(wsConn)

    var session = sessions.getSession(body.key)
    var channel = channels.createChannel(session, wsConn)

    message = {
      type: "response",
      name: "connect",
      from: "server",
      id:   message.id,
      body: null
    }

    wsConn.sendUTF(JSON.stringify(message))
    cleanUp()
  }
1030044
function _wrapMessageHandler(onmessage) {
            return function(message) {
                var msgObject;

                if (!message.origin || "*" === message.origin ||  this.targetOrigin === message.origin) {
                    if (_isHandshake.call(this, message) && !this.disposed && !this.hosted && !this.ready) {
                        _onReady.call(this);
                    }
                    else {
                        try {
                            msgObject = this.deserialize(message.data);

                            if (_validateToken.call(this, msgObject)) {
                                return onmessage && onmessage(msgObject);
                            }
                        }
                        catch (ex) {
                            msgObject = message.data || message;
                            PostMessageUtilities.log("Error while trying to handle the message", "ERROR", "PostMessageChannel");
                        }

                        return msgObject || message;
                    }
                }
            };
        }
288692
public void onMessage(WSMessage message) {
        log.trace("Listeners: {}", listeners.size());
        for (IWebSocketDataListener listener : listeners) {
            try {
                listener.onWSMessage(message);
            } catch (Exception e) {
                log.warn("onMessage exception", e);
            }
        }
    }
1064156
function onFinished (msg, listener) {
  if (isFinished(msg) !== false) {
    defer(listener, null, msg)
    return msg
  }

  // attach the listener to the message
  attachListener(msg, listener)

  return msg
}
818326
function (message) {
        if (this.isEnabled(Level.LOG)) {
            console.log.apply(console, logArgs(Level.LOG, this.category, arguments));
        }
    }
574370
@Override
	public void callback(final AbstractMessage msg) {

		synchronized (lock) {

			hasTimeout = false;
			message = msg;

			lock.notify();
		}
	}
173714
public void processThisMessage()
    {
        Utility.getLogger().info("On message called in receiving process");
        try {
            BaseMessage messageIn = this.getMessage();
            if (messageIn != null)
            {
                BaseMessage messageReply = this.createReplyMessage(messageIn);
                this.moveScreenParamsToMessage(messageReply);
                // Step 2 - Get the body part of the message
                this.getTransport().setupReplyMessage(messageReply, messageIn, MessageInfoTypeModel.REPLY, MessageTypeModel.MESSAGE_IN);
            
                this.getTransport().processIncomingMessage(messageReply, null);
            }
        } catch(Exception ex) {
            ex.printStackTrace();
            Debug.print(ex, "Error in processing or replying to a message");
        }
    }