msngr.js
function (msgOrIds, payload, callback) {
        var ids = (external.is(msgOrIds).array) ? msgOrIds : messageIndex.query(msgOrIds);

        if (ids.length > 0) {
            var methods = [];
            var toDrop = [];
            for (var i = 0; i < ids.length; ++i) {
                var msg = (external.is(msgOrIds).object) ? external.copy(msgOrIds) : external.copy(messageIndex.query(ids[i]));
                var obj = handlers[ids[i]];
                methods.push({
                    method: obj.handler,
                    params: [payload, msg]
                });

                if (obj.once === true) {
                    toDrop.push({
                        msg: msg,
                        handler: obj.handler
                    });
                }
            }

            var execs = internal.executer(methods);

            for (var i = 0; i < toDrop.length; ++i) {
                external(toDrop[i].msg).drop(toDrop[i].handler);
            }

            execs.parallel(callback);
        }
    }
function (msgOrIds, payload, callback) {
        var ids = (external.is(msgOrIds).array) ? msgOrIds : messageIndex.query(msgOrIds);

        if (ids.length > 0) {
            var methods = [];
            var toDrop = [];
            for (var i = 0; i < ids.length; ++i) {
                var msg = (external.is(msgOrIds).object) ? external.copy(msgOrIds) : external.copy(messageIndex.query(ids[i]));
                var obj = handlers[ids[i]];
                methods.push({
                    method: obj.handler,
                    params: [payload, msg]
                });

                if (obj.once === true) {
                    toDrop.push({
                        msg: msg,
                        handler: obj.handler
                    });
                }
            }

            var execs = internal.executer(methods);

            for (var i = 0; i < toDrop.length; ++i) {
                external(toDrop[i].msg).drop(toDrop[i].handler);
            }

            execs.parallel(callback);
        }
    }
function ( msgOrIds , payload , callback ) { var ids = ( external . is ( msgOrIds ) . array ) ? msgOrIds : messageIndex . query ( msgOrIds ) ; if ( ids . length > 0 ) { var methods = [ ] ; var toDrop = [ ] ; for ( var i = 0 ; i < ids . length ; ++ i ) { var msg = ( external . is ( msgOrIds ) . object ) ? external . copy ( msgOrIds ) : external . copy ( messageIndex . query ( ids [ i ] ) ) ; var obj = handlers [ ids [ i ] ] ; methods . push ( { method : obj . handler , params : [ payload , msg ] } ) ; if ( obj . once === true ) { toDrop . push ( { msg : msg , handler : obj . handler } ) ; } } var execs = internal . executer ( methods ) ; for ( var i = 0 ; i < toDrop . length ; ++ i ) { external ( toDrop [ i ] . msg ) . drop ( toDrop [ i ] . handler ) ; } execs . parallel ( callback ) ; } }
An explicit emit
An explicit emit