rpc-over-ipc
v1.0.0
Published
Lightweight RPC over IPC for node.js
Downloads
729
Readme
rpc-over-ipc
Lightweight RPC over IPC for node.js
Install
$ npm i rpc-over-ipc
API
register(proc, name, func)
proc
-ChildProcess
instance orprocess
name
- function namefunc
- asynchronous function to call, last argument should be a callback function that takeserr
andresult
arguments
Example
var rpc = require('rpc-over-ipc');
rpc.register(process, 'add', function(a, b, callback) {
callback(null, a + b);
});
call(proc, name, [args], callback)
proc
-ChildProcess
instance orprocess
name
- function nameargs
- array the arguments with whichname
function should be called, optionalcallback
- callback function which is called whenname
functions have finished
Example
var rpc = require('rpc-over-ipc');
rpc.call(process, 'add', [1, 2], function(err, result) {
console.log(result);
});