index.js
function handleMessage(event, message) {
	/*jshint validthis: true */
	if (DEBUG_DISPATCHER) log.info('MESSAGE: ' + event);
	if (!event) {
		return;
	}
	if (message && message !== '') {
		throw 'A message payload was sent across Redis. We intentionally do not support this to avoid security issues.';
	}

	var callbacks = this.dispatcher._callbacks[event];
	if (DEBUG_DISPATCHER) log.info('MESSAGE: CALLBACK LENGTH: ' + (callbacks && callbacks.length));
	for (var i = 0, iL = callbacks && callbacks.length; i < iL; i++) {
		callbacks[i].call(this.dispatcher._context, event);
	}
}
function handleMessage(event, message) {
	/*jshint validthis: true */
	if (DEBUG_DISPATCHER) log.info('MESSAGE: ' + event);
	if (!event) {
		return;
	}
	if (message && message !== '') {
		throw 'A message payload was sent across Redis. We intentionally do not support this to avoid security issues.';
	}

	var callbacks = this.dispatcher._callbacks[event];
	if (DEBUG_DISPATCHER) log.info('MESSAGE: CALLBACK LENGTH: ' + (callbacks && callbacks.length));
	for (var i = 0, iL = callbacks && callbacks.length; i < iL; i++) {
		callbacks[i].call(this.dispatcher._context, event);
	}
}
function handleMessage ( event , message ) { /*jshint validthis: true */ if ( DEBUG_DISPATCHER ) log . info ( 'MESSAGE: ' + event ) ; if ( ! event ) { return ; } if ( message && message !== '' ) { throw 'A message payload was sent across Redis. We intentionally do not support this to avoid security issues.' ; } var callbacks = this . dispatcher . _callbacks [ event ] ; if ( DEBUG_DISPATCHER ) log . info ( 'MESSAGE: CALLBACK LENGTH: ' + ( callbacks && callbacks . length ) ) ; for ( var i = 0 , iL = callbacks && callbacks . length ; i < iL ; i ++ ) { callbacks [ i ] . call ( this . dispatcher . _context , event ) ; } }
An internal method, called when a new message is received. It loops through all callbacks for the event, and executes them.
@param event The string name for an event that was passed to the "publish" call.
@param message A string payload sent with the publish.
An internal method called when a new message is received . It loops through all callbacks for the event and executes them .