1.0.0 • Published 8 years ago

rpc-over-ipc v1.0.0

Weekly downloads
52
License
MIT
Repository
github
Last release
8 years ago

rpc-over-ipc

Build Status Coverage Status NPM Version

Lightweight RPC over IPC for node.js

Install

$ npm i rpc-over-ipc

API

register(proc, name, func)

  • proc - ChildProcess instance or process
  • name - function name
  • func - asynchronous function to call, last argument should be a callback function that takes err and result 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 or process
  • name - function name
  • args - array the arguments with which name function should be called, optional
  • callback - callback function which is called when name functions have finished

Example

	var rpc = require('rpc-over-ipc');
	rpc.call(process, 'add', [1, 2], function(err, result) {
		console.log(result);
	});

License

The MIT License