@tempest/core
Version:
The core of the Tempest Stream Library
20 lines • 494 B
JavaScript
export class PredeterminedTask {
constructor(delay, period, task, scheduler) {
this.time = delay;
this.period = period;
this.task = task;
this.scheduler = scheduler;
this.active = true;
}
run() {
this.task.run(this.time);
}
error(err) {
this.task.error(this.time, err);
}
dispose() {
this.scheduler.cancel(this);
return this.task.dispose();
}
}
//# sourceMappingURL=PredeterminedTask.js.map