An interface and test suite to implement various scheduling algorithms.
Last updated 5 months ago by derhuerst .
ISC · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install abstract-scheduler 
SYNC missed versions from official npm registry.


An interface and test suite to implement various scheduling algorithms. The goal is to define a simple and flexible standard for libraries that implement scheduling algorithms, so that you can replace them easily.

const createScheduler = require('any-abstract-scheduler-compatible')

const servers = createScheduler(['1.example.com', '2.example.com'])
servers.get() // '1.example.com'
servers.get() // '2.example.com'
servers.get() // '1.example.com'

npm version build status minimum Node.js version ISC-licensed

abstract-scheduler-compatible modules

Send a PR by adding yours!


Include this badge if you make a library compatible with abstract-scheduler.

compatible with abstract-scheduler

[![compatible with abstract-scheduler](https://unpkg.com/abstract-scheduler@4/badge.svg)](https://github.com/derhuerst/abstract-scheduler)

How to test for abstract-scheduler compatibility

npm i abstract-scheduler --save-dev

Include this in your test file:

const runAbstractSchedulerTests = require('abstract-scheduler')
const createMyScheduler = require('.')


tape will be used to test, writing TAP to stdout.

The abstract-scheduler API

createScheduler(values = [])

Create an empty scheduler or provide some initial values.


Add a value to the scheduler. Returns the (0-based) index of the stored value.


Remove a value by (0-based) index. Returns true if the scheduler contained value, false otherwise.


Checks whether the given value is already in the scheduler. Returns either true or false.


Get the next value according to the scheduling algorithm.


abstract-scheduler is inspired by abstract-chunk-store, abstract-blob-store and abstract-point-store.


If you have a question or need support using abstract-scheduler, refer to the issues page.

Current Tags

  • 4.0.0                                ...           latest (5 months ago)

5 Versions

  • 4.0.0                                ...           5 months ago
  • 3.0.1                                ...           5 months ago
  • 3.0.0                                ...           2 years ago
  • 2.0.0                                ...           2 years ago
  • 0.6.0 [deprecated]           ...           3 years ago
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 4
Dependencies (1)
Dev Dependencies (1)
Dependents (0)

Copyright 2014 - 2016 © taobao.org |