1.0.2 • Published 5 years ago

egg-thrift-client v1.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
5 years ago

egg-thrift-client

NPM version npm download

依赖说明

依赖的插件

需要在egg项目中安装thrift:

$ npm i thrift

开启插件

// config/plugin.js
exports.thriftClient = {
  enable: true,
  package: 'egg-thrift-client',
};

使用场景

插件用于在 egg 中创建 thrift client ,使用时建议增加心跳机制来保持连接。

demo

app.thriftClient.get('microService').client.doSomething(params, (err, res) => {
  if (err) {
    // errorHandle();
  } else {
    // resHandle();
  }
});

详细配置

请到 config/config.default.js 查看详细配置项说明。

License

MIT