@theopenweb/full-backoff-jitter

1.0.0 • Public • Published

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

/@theopenweb/full-backoff-jitter/

    Package Sidebar

    Install

    npm i @theopenweb/full-backoff-jitter

    Weekly Downloads

    0

    Version

    1.0.0

    License

    MIT

    Unpacked Size

    17.4 kB

    Total Files

    5

    Last publish

    Collaborators

    • theopenweb_jp