retry-connection

1.0.1 • Public • Published

retry-connection

This module takes a host and a port and will keep checking that connection on a given interval.

Install

npm install retry-connection

Use

var conn = require('retry-connection')({
    host     : 'some.host',
    port     : 8000,
    interval : 1000, // (default 1000)
    timeout  : 500   // (default 500)
})
conn.on('ready', function() {})
conn.on('issue', function(issue) {})

The module holds internal state about readiness; meaning it will only emit a ready event on initial connection or after an issue has occurred. While the connection keeps being ready, no new ready event is emitted. Issue events however keep being emitted for each failing attempt.

Changelog

1.0.1

  • Added the dependecies to package.json 🙈

1.0.0

  • Initial release 🎉

enjoy

Readme

Keywords

Package Sidebar

Install

npm i retry-connection

Weekly Downloads

2

Version

1.0.1

License

BSD

Last publish

Collaborators

  • asbjornenge