1.1.1 • Published 3 years ago

roundrobin-list v1.1.1

Weekly downloads
10
License
MIT
Repository
github
Last release
3 years ago

RoundRobin List

round-robin list is a Weighted Round Robin resource pool with the possibility to select the starting resource

Using

npm install roundrobin-list

Basic usage

const { RoundRobinList } = require('roundrobin-list');

// Without initial values
const listWithoutValues = new RoundRobinList();

listWithoutValues.add({ value: 'A', weight: 3 });
listWithoutValues.add({ value: 'B', weight: 2 });
listWithoutValues.add({ value: 'C', weight: 2 });

// With values 
const listWithValues = new RoundRobinList([
    { value: 'A', weight: 4 },
    { value: 'B', weight: 3 },
    { value: 'C', weight: 2 },
]);

License

MIT

1.1.1

3 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago