0.3.1 • Published 2 years ago

@gallofeliz/scheduler v0.3.1

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

Scheduler

npm.io

Note: This module is part of @gallofeliz/js-libs that is a personal project. It is not developed nor tested for applications that need high security or scalability.

This is not a tasker. To handle complex job management, see @gallofeliz/tasker

"when" uses @gallofeliz/dates-iterators

// Simple Schedule

schedule({
    fn(infos) {
        console.log('Do job')
    },
    when: {
        times: ['PT2S'],
        limit: 5
    }
})

// Scheduler

const scheduler = new Scheduler({
    onError(error, id) {
        console.log('error on', id, error)
    }
})

scheduler.schedule({
    id: 'test1',
    fn() {
        console.log('Do job 1')
    },
    when: ['PT1S']
})

scheduler.start(abortSignal)
0.3.0

2 years ago

0.3.1

2 years ago

0.2.1

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago