lib/core/requester.js
function request(ipc, name, args) {

		// check online
		if (!ipc.root.online) {
			ipc.root.emit('error', new Error("Could not make a request, channel is offline"));
			return;
		}

		// store callback for later
		var callback = args.pop();

		// check that a callback is set
		if (typeof callback !== 'function') {
			ipc.root.emit('error', new TypeError("No callback specified"));
			return;
		}

		// send request to remote
		ipc.send('call', [name, args], function (sucess, content) {
			if (sucess) {
				callback.apply({
					error: null
				}, content);
			} else {
				callback.apply({
					error: helpers.object2error(content)
				}, []);
			}
		});
	}
function request(ipc, name, args) {

		// check online
		if (!ipc.root.online) {
			ipc.root.emit('error', new Error("Could not make a request, channel is offline"));
			return;
		}

		// store callback for later
		var callback = args.pop();

		// check that a callback is set
		if (typeof callback !== 'function') {
			ipc.root.emit('error', new TypeError("No callback specified"));
			return;
		}

		// send request to remote
		ipc.send('call', [name, args], function (sucess, content) {
			if (sucess) {
				callback.apply({
					error: null
				}, content);
			} else {
				callback.apply({
					error: helpers.object2error(content)
				}, []);
			}
		});
	}
function request ( ipc , name , args ) { // check online if ( ! ipc . root . online ) { ipc . root . emit ( 'error' , new Error ( "Could not make a request, channel is offline" ) ) ; return ; } // store callback for later var callback = args . pop ( ) ; // check that a callback is set if ( typeof callback !== 'function' ) { ipc . root . emit ( 'error' , new TypeError ( "No callback specified" ) ) ; return ; } // send request to remote ipc . send ( 'call' , [ name , args ] , function ( sucess , content ) { if ( sucess ) { callback . apply ( { error : null } , content ) ; } else { callback . apply ( { error : helpers . object2error ( content ) } , [ ] ) ; } } ) ; }
request a method from the listener
request a method from the listener