Skip to content

A very simple exponential backoff implementation

License

Notifications You must be signed in to change notification settings

GavinDmello/backoff

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

A very simple exponential backoff implementation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published