1.0.0 • Published 2 years ago

@theopenweb/full-backoff-jitter v1.0.0

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

Description

Full backoff jitter algorithm with options, variations and time testing.

Uses es6 imports/exports. For commonjs, global, please build. If is considered a common case, please create an issue or pull request.

Usage

npm install @theopenweb/full-backoff-jitter

import FullBackoffJitter from '@theopenweb/full-backoff-jitter'

const options = {
    connections: 20,
    maxConnections: 5,
    duration: 10,
    penalty: 100,
    maxAttempts: 1,
    maxSingleDuration: 30000
};

const fullBackoffJitter = FullBackoffJitter();
fullBackoffJitter.executeWithFullBackoffJitter(func, options)
.then(console.log)
.catch(console.error);

Test

npx http-server ./
# http://localhost:8080/index.html