Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

storm-drpc-node

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

storm-drpc-node

Apache storm DRPC client for Node.js

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

storm-drpc-node

Apache storm DRPC client for Node.js

Inspired by node-drpc, but the difference is that it can be optionally set keep alive, it does't need to createConnection in every execute() call, and one can use it in the traditional or promise way as it like.

Install

npm install storm-drpc-node

Usage

var DRPC = require('storm-drpc-node');

var drpcClient = new DRPC(options);

options

  • host: drpc cluster client host

  • port: drpc client port, default to 3772

  • timeout: TCP connection timeout time, default to null

  • keepAlive: keep connect alive, default to true

  • maxConnectCounts: the mximum connect counts, if the param keepAlive is set true, client will reconnect to storm until the connect counts exceed the maxConnectCounts.

Events

  • error: emit when exception occurs

  • close: emit when connect close while conection is keepAlive

  • connect: emit when connection ready

  • timeout: timeout event listener

Methods

  • execute(String spoutName, String emitValue[, Function callback]): call storm drpc cluster by thrift protocol

Example

var DRPC = require('storm-drpc-node');

var client = DRPC({
    host: '127.0.0.1',
    port: 3772,
    timeout: 1000,
    keepAlive: true,
    maxConnectCounts: 30
});

client.on('error', function(err) {
    throw err;
});

// promise way
client.execute('spout-name', JSON.stringify(data))
    .then(function(res) {
        console.log(res);
    })
    .catch(function(err) {
        throw err;
    });

// callback way
client.execute('spout-name', JSON.stringify(data), function(err, res) {
    if(err) throw err;
    else console.log(res);
});

Licence

storm-drpc-node is licenced under the MIT licence.

Keywords

FAQs

Package last updated on 08 Oct 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc