@taoro/scheduler

1.0.4 • Public • Published

Scheduler System

Simple scheduling system using generator functions and iterators as tasks.

const scheduler = new Scheduler()

function * Task() {
  // This task will run forever without blocking
  // the main thread.
  while (true) {
    yield
  }
}

scheduler.add(Task())

// Run all tasks every 1 second.
setInterval(() => scheduler.update(), 1000)

Readme

Keywords

Package Sidebar

Install

npm i @taoro/scheduler

Weekly Downloads

0

Version

1.0.4

License

MIT

Unpacked Size

3.43 kB

Total Files

4

Last publish

Collaborators

  • azazeln28