A javascript library for managing schedule job
let job = new ScheduleJob({ interval: 1000 }, callback)
let job = new ScheduleJob({ interval: 1000, repeat: true }, callback)
let someDate = new Date('2018-2-26 10:10:10')
let job = new ScheduleJob({ date: someDate }, callback)
let someDate = new Date('2018-2-26 10:10:10')
let job = new ScheduleJob({ date: someDate, repeat: true}, callback)
job.start()
job.terminate()
job.nextExec // { start: 2019-05-16T15:49:56.906Z, timeSpan: 3013, success: true }
job.prevExec // { start: 2019-05-16T15:60:56.906Z, timeSpan: 3013, success: true }
job.currentExec // { start: 2019-05-16T15:49:56.906Z, timeSpan: 3013, success: true }
job.history //
[
{ start: 2019-05-16T15:42:56.906Z, timeSpan: 3013, success: true },
{ start: 2019-05-16T15:49:56.906Z, timeSpan: 3013, success: false, error: ... }
]
- id
- type
- actived
- jobTypes [static]
- ONE_TIME: 0
- REPEAT: 1
- REPEAT_AT_TIME: 2
- history
- nextExec
- currentExec
- prevExec
}