https://github.com/iamnapo/drpcjs
🍬 Apache storm DRPC client for Node.js.
https://github.com/iamnapo/drpcjs
drpc drpcjs node-drpc storm storm-node storm-topology
Last synced: 2 months ago
JSON representation
🍬 Apache storm DRPC client for Node.js.
- Host: GitHub
- URL: https://github.com/iamnapo/drpcjs
- Owner: iamnapo
- License: mit
- Created: 2018-12-13T13:25:50.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-05-11T23:03:29.000Z (about 5 years ago)
- Last Synced: 2025-01-01T01:30:05.832Z (over 1 year ago)
- Topics: drpc, drpcjs, node-drpc, storm, storm-node, storm-topology
- Language: JavaScript
- Homepage:
- Size: 85 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# drpcjs
> Apache storm DRPC client for Node.js
[](https://github.com/iamnapo/drpcjs/actions) [](https://www.npmjs.com/package/drpcjs)
[](./LICENSE)
## Install
```console
$ npm i drpcjs
```
## Usage
```javascript
const Drpcjs = require("drpcjs");
const drpc = new Drpcjs(options);
```
### **options**
- `host`: drpc cluster hostname
- `port`: drpc client port, default to 3772
- `timeout`: TCP connection timeout time, default to null
- `keepAlive`: keep connect alive, default to true
- `maxConnectCounts`: the maximum connect counts, if the param `keepAlive` is
set true, client will reconnect to storm until the connect counts exceed the maxConnectCounts.
### **events**
- `error`
- `close`
- `connect`
- `timeout`
### **methods**
```javascript
execute(topologyName, JSON.stringify(args));
```
## Example
```javascript
const drpcjs = require('drpcjs');
const drpc = new drpcjs({ host: '127.0.0.1' });
drpc.execute('reach', JSON.stringify({ a: 'a', b: 7, c: true }).then(console.log).catch(console.error);
```
## Acknowledgements
Based on [`node-drpc`](https://github.com/rkatti/node-drpc).