ezrpc
Easy to use RPC server/client (+ load balancer)
// server.jsconst Server = const server = 1250 // run rpc server on port 1250 { console} // Make helloWorld accessible by the remote clientservermoduleexports = helloWorld
// client.jsconst Client = const helloWorld = 'localhost' 1250methods
Installing
$ npm install ezrpc
$ yarn add ezrpc
Why?
- Easily load-balance tasks among multiple processes on multiple machines
- Can be used like a child process, but does not have to be spawned on every function call
- ezrpc servers can be used in almost any language
Docs
The wiki will help you get started with ezrpc
Additionally you can generate html documentation of all all method & properties using jsdoc
using the doc
script:
$ npm run doc
$ yarn doc
Documentation will appear in /jsdoc
Tests
Tests are not included when you download from npm; clone the GitHub repository to run tests.
npm
$ npm install$ npm test
yarn
$ yarn install$ yarn test
Examples
Some basic explanatory examples can be found here. They currently include a simple master-child example where the master (client.js) calls methods on the child process (server.js), and an example where the LoadBalancer class is used to distribute calls among multiple servers.