This repository has been archived on 2023-03-25. You can view files and clone it, but cannot push or open issues or pull requests.
mightyscape-1.1-deprecated/extensions/fablabchemnitz/papercraft/openjscad/node_modules/most/lib/scheduler/ScheduledTask.js

30 lines
710 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = ScheduledTask;
/** @license MIT License (c) copyright 2010-2016 original author or authors */
/** @author Brian Cavalier */
/** @author John Hann */
function ScheduledTask(delay, period, task, scheduler) {
this.time = delay;
this.period = period;
this.task = task;
this.scheduler = scheduler;
this.active = true;
}
ScheduledTask.prototype.run = function () {
return this.task.run(this.time);
};
ScheduledTask.prototype.error = function (e) {
return this.task.error(this.time, e);
};
ScheduledTask.prototype.dispose = function () {
this.scheduler.cancel(this);
return this.task.dispose();
};