arpeecee
Simple duplex stream based binary RPC module for well defined services and methods
npm install arpeecee
Usage
const RPC = require('arpeecee')
const stream = new RPC({
errorEncoding: someAbstractEncoding
})
const aMethod = stream.defineService({ id: 1 })
.defineMethod({
id: 1,
requestEncoding: someAbstractEncoding,
responseEncoding: someAbstractEncoding,
async onrequest (value) {
console.log('decoded request', value)
}
})
const decodedResponse = await aMethod.request(decodedValue)
stream.pipe(someStream).pipe(stream)
LICENSE
MIT