maxtaco/node-fast-msgpack-rpc
node-fast-msgpack-rpc is an implementation of the Msgpack-RPC protocol specification for node.js. Msgpack-RPC is built ontop of the very fast MessagePack serialization format. This implementation supports tcp and unix socket transports.
This is a "fast" version of Msgpack-RPC. The big difference here is that the length of the packet is prepended to each packet, meaning we don't need to keep iteratively decoding the packet over and over again. Seems weird they left this out. This protocol is not compatible with the existing Msgpack, but this module has the same API.
Simple Usage
If you don't care too much about keeping custom per-connection state, it's easy to make a simple RPC server:
var rpc = ;var srv = rpc;srv;
a corresponding client might look like:
var c = rpc;
Or, equivalently, in beautiful IcedCoffeeScript:
await c = rpccreateClient '127.0.0.1'8000deferok"myprog.v1"await cinvoke 'add' a : 5b : 4 defer errresponsecclose
Advanced Usage
(documentation to come)
Installation
First you will need to install the msgpack2 add-on
To install node-msgpack-rpc with npm:
npm install -g msgpack2
Debug and Tracing Hooks
(documentation to come)