0.1.0 • Published 7 years ago

ebackoff v0.1.0

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

Exponential backoff algorithm

This is a very simple implementation of the expoenential backoff algorithm. It returns the amount of time after which the node should retry to transmit. You will have to set the delay yourself.

Installation

npm install ebackoff

Function

  • getBackoff(collisions)

Example usage

	const BackOff = require('./backoff')
	const backoff = new BackOff()

	console.log(backoff.getBackoff(1))
	console.log(backoff.getBackoff(5))
	console.log(backoff.getBackoff(10))

License

MIT