README
tchannel-promise
tchannel promises
tchannel-promise wraps tchannel send() to return a bluebird promise.
Installation
$ npm install tchannel-promise --save
Usage
var TchannelPromise = require('tchannel-promise');
var tchannel = new TChannelPromise(options);
var testChannel = tchannel
.makeSubChannel({serviceName: 'test'});
var bluebirdPromise = testChannel
.request()
.send('echo', 'arg1', 'arg2');
bluebirdPromise
.then(function onSuccess(result){
// handle successful result
// result.response
// result.arg2
// result.arg3
}, function onFailure(err){
// handle error err
})
.catch(function onException(ex){
// handle exception ex
});