0.2.3 • Published 8 years ago

node-reconnect v0.2.3

Weekly downloads
26
License
-
Repository
github
Last release
8 years ago

reconnect

node.js module that keep connection to other services alive. This is something that keeps your service (for example kafka-node) alive when it doesn't recover by itself (example issue #209.

Done when working on Tapdaq.

Usage

  instance = new Reconnect({
    repeatDelay: 1 // delay in ms
  });
  instance.handleConnect((readyCallback, errorCallback) => {
    const service = new dummyService();
    service.on('ready', () => {
      // service.on('data', ....)


      // when your connection is ready
      readyCallback();
    });

    service.on('error', errorCallback);

    return service;
  });

Development

Run tests with mocha (that re-run on file change). And change whatever you want

npm run test

Todo

  • Add better documentation
  • Add reconnect count
0.2.3

8 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago