egg-thrift-client

1.0.2 • Public • Published

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

Package Sidebar

Install

npm i egg-thrift-client

Weekly Downloads

0

Version

1.0.2

License

MIT

Unpacked Size

8.2 kB

Total Files

9

Last publish

Collaborators

  • mecoepcoo