rpc-stream
Version:
very simple rpc. use with any thing that has .pipe()
23 lines (18 loc) • 380 B
JavaScript
var rpc = require('../')
var test = require('tape')
test('double callback', function (t) {
var b = rpc()
b.pipe(rpc({
hello: function (cb) {
cb(null, 'first')
cb(null, 'second')
}
})).pipe(b)
b.on('invalid callback id', function () {
t.fail()
})
b.createRemoteCall('hello')(function (err, str) {
t.equal(str, 'first')
})
t.end()
})