tchannel-promise

1.1.0 • Public • Published

tchannel-promise NPM version Dependency Status Coverage Status

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
    });
 

License

© Rajesh Segu

Readme

Keywords

Package Sidebar

Install

npm i tchannel-promise

Weekly Downloads

0

Version

1.1.0

License

MIT

Last publish

Collaborators

  • rajeshsegu