This commit is contained in:
LosslessBot 2016-05-05 19:21:50 +02:00
parent 5fd11ec9c0
commit 0d0ee67ca3
6 changed files with 35 additions and 15 deletions

View File

@ -5,3 +5,4 @@ export declare let isTaskTouched: (task: Task, touchedTasksArray: Task[]) => boo
export declare let runTask: (taskArg: Task, optionsArg?: {
touchedTasksArray: Task[];
}) => any;
export declare let runBufferedTask: (taskArg: Task) => void;

File diff suppressed because one or more lines are too long

View File

@ -14,8 +14,10 @@ export declare class Task {
preTask?: Task;
afterTask?: Task;
buffered?: boolean;
bufferMax?: number;
});
trigger(): any;
triggerBuffered(): void;
trigger(): void;
triggerUnBuffered(): any;
triggerBuffered(): any;
state: string;
}

View File

@ -14,14 +14,29 @@ var Task = (function () {
this.idle = true;
this.running = false;
this.buffered = options.buffered;
this.bufferMax = options.bufferMax;
}
Task.prototype.trigger = function () {
var done = plugins.Q.defer();
return helpers.runTask(this);
if (this.buffered) {
this.triggerBuffered();
}
else {
this.triggerUnBuffered();
}
;
};
;
Task.prototype.triggerUnBuffered = function () {
return helpers.runTask(this);
};
Task.prototype.triggerBuffered = function () {
var done = plugins.Q.defer();
if (!(this.bufferCounter >= this.bufferMax)) {
this.bufferCounter++;
}
helpers.runBufferedTask(this);
return done.promise;
};
Object.defineProperty(Task.prototype, "state", {
get: function () {
@ -42,4 +57,4 @@ var Task = (function () {
}());
exports.Task = Task;
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRhc2tidWZmZXIuY2xhc3Nlcy50YXNrLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSw0Q0FBNEM7QUFDNUMsSUFBWSxPQUFPLFdBQU0sc0JBQ3pCLENBQUMsQ0FEOEM7QUFDL0MsSUFBWSxPQUFPLFdBQU0sOEJBR3pCLENBQUMsQ0FIc0Q7QUFHdkQ7SUFZSSxjQUFZLFVBQThFO1FBQ3RGLEVBQUUsQ0FBQyxDQUFDLENBQUMsVU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biAgICB9XG59Il19

View File

@ -1,8 +1,8 @@
import * as classes from "./taskbuffer.classes";
export declare class Taskchain extends classes.Task {
taskArray: classes.Task[];
constructor(taskArrayArg: classes.Task[] | classes.Task);
addTask(taskArg: classes.Task): void;
removeTask(taskArg: classes.Task): void;
import { Task } from "./taskbuffer.classes";
export declare class Taskchain extends Task {
taskArray: Task[];
constructor(taskArrayArg: Task[] | Task);
addTask(taskArg: Task): void;
removeTask(taskArg: Task): void;
shiftTask(): void;
}

View File

@ -6,7 +6,7 @@ var __extends = (this && this.__extends) || function (d, b) {
};
/// <reference path="./typings/main.d.ts" />
var plugins = require("./taskbuffer.plugins");
var classes = require("./taskbuffer.classes");
var taskbuffer_classes_1 = require("./taskbuffer.classes");
var Taskchain = (function (_super) {
__extends(Taskchain, _super);
function Taskchain(taskArrayArg) {
@ -43,11 +43,11 @@ var Taskchain = (function (_super) {
};
;
return Taskchain;
}(classes.Task));
}(taskbuffer_classes_1.Task));
exports.Taskchain = Taskchain;
;
var myTask = new Taskchain(new classes.Task({
var myTask = new Taskchain(new taskbuffer_classes_1.Task({
taskFunction: function () { }
}));
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRhc2tidWZmZXIuY2xhc3Nlcy50YXNrY2hhaW4udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBQUEsNENBQTRDO0FBQzVDLElBQVksT0FBTyxXQUFNLHNCQUFzQixDQUFDLENBQUE7QUFDaEQsSUFBWSxPQUFPLFdBQU0sc0JBQ3pCLENBQUMsQ0FEOEM7QUFHL0M7SUFBK0IsNkJBQVk7SUFHdkMsbUJBQVksWUFBd0M7UUFIeEQsaUJBNEJDO1FBeEJPLGtCQUFNO1lBQ0YsWUFBWSxFQUFFO2dCQUNWLEVBQUUsQ0FBQSxDQUFDLEtBQUksQ0FBQyxTQUFTLENBQUMsTUFBTSxHQUFHLENBQUMsQ0FBQztvQkFBQ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zdGFydERlZmVycmVkLnByb21pc2U7XG4gICAgICAgICAgICAgICAgZm9yKGxldCBrZXlBcmcgaW4gdGhpcy50YXNrQXJyYXkpe1xuICAgICAgICAgICAgICAgICAgICBwcm9taXNlUG9pbnRlci50aGVuKGZ1bmN0aW9uKCl7XG4gICAgICAgICAgICAgICAgICAgICAgICBwcm9taXNlUG9pbnRlciA9IHRoaXMudGFza0FycmF5W2tleUFyZ10udHJpZ2dlcigpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHByb21pc2VQb2ludGVyO1xuICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgc3RhcnREZWZlcnJlZC5yZXNvbHZlKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgIH1cbiAgICBhZGRUYXNrKHRhc2tBcmc6Y2xhc3Nlcy5UYXNrKXtcbiAgICAgICAgdGhpcy50YXNrQXJyYXkucHVzaCh0YXNrQXJnKTtcbiAgICB9O1xuICAgIHJlbW92ZVRhc2sodGFza0FyZzpjbGFzc2VzLlRhc2spe1xuICAgICAgICAvL1RPRE9cbiAgICB9O1xuICAgIHNoaWZ0VGFzaygpe1xuICAgICAgICBcbiAgICB9O1xufTtcblxubGV0IG15VGFzayA9IG5ldyBUYXNrY2hhaW4oXG4gICAgbmV3IGNsYXNzZXMuVGFzayh7XG4gICAgICAgIHRhc2tGdW5jdGlvbjpmdW5jdGlvbigpe31cbiAgICB9KVxuKTsiXX0=
//# sourceMappingURL=data:application/json;charset=utf8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInRhc2tidWZmZXIuY2xhc3Nlcy50YXNrY2hhaW4udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBQUEsNENBQTRDO0FBQzVDLElBQVksT0FBTyxXQUFNLHNCQUFzQixDQUFDLENBQUE7QUFDaEQsbUNBQW1CLHNCQUFzQixDQUFDLENBQU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k7IC8vIHRoaXMgaXMgdGhlIHN0YXJ0aW5nIERlZmVycmVkIG9iamVjdCBcbiAgICAgICAgICAgICAgICBsZXQgcHJvbWlzZVBvaW50ZXIgPSBzdGFydERlZmVycmVkLnByb21pc2U7XG4gICAgICAgICAgICAgICAgZm9yKGxldCBrZXlBcmcgaW4gdGhpcy50YXNrQXJyYXkpe1xuICAgICAgICAgICAgICAgICAgICBwcm9taXNlUG9pbnRlci50aGVuKGZ1bmN0aW9uKCl7XG4gICAgICAgICAgICAgICAgICAgICAgICBwcm9taXNlUG9pbnRlciA9IHRoaXMudGFza0FycmF5W2tleUFyZ10udHJpZ2dlcigpO1xuICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIHByb21pc2VQb2ludGVyO1xuICAgICAgICAgICAgICAgICAgICB9KVxuICAgICAgICAgICAgICAgIH07XG4gICAgICAgICAgICAgICAgc3RhcnREZWZlcnJlZC5yZXNvbHZlKCk7XG4gICAgICAgICAgICB9XG4gICAgICAgIH0pO1xuICAgIH1cbiAgICBhZGRUYXNrKHRhc2tBcmc6VGFzayl7XG4gICAgICAgIHRoaXMudGFza0FycmF5LnB1c2godGFza0FyZyk7XG4gICAgfTtcbiAgICByZW1vdmVUYXNrKHRhc2tBcmc6VGFzayl7XG4gICAgICAgIC8vVE9ET1xuICAgIH07XG4gICAgc2hpZnRUYXNrKCl7XG4gICAgICAgIFxuICAgIH07XG59O1xuXG5sZXQgbXlUYXNrID0gbmV3IFRhc2tjaGFpbihcbiAgICBuZXcgVGFzayh7XG4gICAgICAgIHRhc2tGdW5jdGlvbjpmdW5jdGlvbigpe31cbiAgICB9KVxuKTsiXX0=