update from q to smartq

This commit is contained in:
Philipp Kunz 2017-01-19 17:26:35 +01:00
parent 670bf5b124
commit eb7eb14415
17 changed files with 68 additions and 73 deletions

2
dist/index.js vendored
View File

@ -9,4 +9,4 @@ var taskbuffer_classes_taskspace_1 = require("./taskbuffer.classes.taskspace");
exports.Taskspace = taskbuffer_classes_taskspace_1.Taskspace; exports.Taskspace = taskbuffer_classes_taskspace_1.Taskspace;
// import for naming only // import for naming only
require("./taskbuffer.classes.helpers"); require("./taskbuffer.classes.helpers");
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsd0NBQWlDLDJCQUEyQixDQUFDO0FBQXJELDhDQUFxRDtBQUM3RCw2Q0FBd0IsZ0NBQWdDLENBQUM7QUFBakQsNkRBQWlEO0FBQ3pELGdEQUEyQixtQ0FBbUMsQ0FBQztBQUF2RCxzRUFBdUQ7QUFDL0QsNkNBQXdCLGdDQUFnQyxDQUFDO0FBQWpELDZEQUFpRDtBQUV6RCx5QkFBeUI7QUFDekIsUUFBTyw4QkFBOEIsQ0FBQyxDQUFEIn0= //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEscUVBQTZEO0FBQXJELHlDQUFBLElBQUksQ0FBQTtBQUNaLCtFQUF5RDtBQUFqRCxtREFBQSxTQUFTLENBQUE7QUFDakIscUZBQStEO0FBQXZELHlEQUFBLFlBQVksQ0FBQTtBQUNwQiwrRUFBeUQ7QUFBakQsbURBQUEsU0FBUyxDQUFBO0FBRWpCLHlCQUF5QjtBQUN6Qix3Q0FBcUMifQ==

View File

@ -1,24 +1,21 @@
/// <reference types="q" />
import plugins = require("./taskbuffer.plugins"); import plugins = require("./taskbuffer.plugins");
import { Task, ITaskFunction } from "./taskbuffer.classes.task"; import { Task, ITaskFunction } from "./taskbuffer.classes.task";
import { Promise } from "q";
export { Promise } from "q";
export declare let emptyTaskFunction: ITaskFunction; export declare let emptyTaskFunction: ITaskFunction;
export declare let isTask: (taskArg: any) => boolean; export declare let isTask: (taskArg: Task) => boolean;
export declare let isTaskTouched: (taskArg: Task, touchedTasksArray: Task[]) => boolean; export declare let isTaskTouched: (taskArg: Task, touchedTasksArray: Task[]) => boolean;
export declare let runTask: (taskArg: Task, optionsArg: { export declare let runTask: (taskArg: Task, optionsArg: {
x?: any; x?: any;
touchedTasksArray?: Task[]; touchedTasksArray?: Task[];
}) => plugins.Q.Promise<{}>; }) => Promise<{}>;
export interface cycleObject { export interface cycleObject {
cycleCounter: number; cycleCounter: number;
deferred: plugins.Q.Deferred<any>; deferred: plugins.q.Deferred<any>;
} }
export declare class CycleCounter { export declare class CycleCounter {
task: Task; task: Task;
cycleObjectArray: cycleObject[]; cycleObjectArray: cycleObject[];
constructor(taskArg: Task); constructor(taskArg: Task);
getPromiseForCycle(cycleCountArg: number): plugins.Q.Promise<{}>; getPromiseForCycle(cycleCountArg: number): Promise<{}>;
informOfCycle(x: any): void; informOfCycle(x: any): void;
} }
export declare class BufferRunner { export declare class BufferRunner {

File diff suppressed because one or more lines are too long

View File

@ -1,7 +1,4 @@
/// <reference types="q" />
import * as helpers from "./taskbuffer.classes.helpers"; import * as helpers from "./taskbuffer.classes.helpers";
import { Promise } from "q";
export { Promise } from "q";
export interface ITaskFunction { export interface ITaskFunction {
(x?: any): PromiseLike<any>; (x?: any): PromiseLike<any>;
} }

View File

@ -1,8 +1,6 @@
"use strict"; "use strict";
const plugins = require("./taskbuffer.plugins"); const plugins = require("./taskbuffer.plugins");
const helpers = require("./taskbuffer.classes.helpers"); const helpers = require("./taskbuffer.classes.helpers");
var q_1 = require("q");
exports.Promise = q_1.Promise;
class Task { class Task {
constructor(optionsArg) { constructor(optionsArg) {
// initialize by default // initialize by default
@ -53,9 +51,9 @@ class Task {
this._state = "locked"; this._state = "locked";
} }
else { else {
plugins.beautylog.error("state type " + stateArg.blue + " could not be set"); plugins.beautylog.error("state type " + stateArg + " could not be set");
} }
} }
} }
exports.Task = Task; exports.Task = Task;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFza2J1ZmZlci5jbGFzc2VzLnRhc2suanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi90cy90YXNrYnVmZmVyLmNsYXNzZXMudGFzay50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsTUFBWSxPQUFPLFdBQU0sc0JBQ3pCLENBQUMsQ0FEOEM7QUFDL0MsTUFBWSxPQUFPLFdBQU0sOEJBR3pCLENBQUMsQ0FIc0Q7QUFJdkQsa0JBQXNCLEdBQUcsQ0FBQztBQUFsQiw4QkFBa0I7QUFNMUI7SUFjSSxZQUFZLFVBT1g7UUFkRCx3QkFBd0I7UUFDeEIsWUFBTyxHQUFXLEtBQUssQ0FBQztRQUN4QixpQkFBWSxHQUFHLElBQUksT0FBTyxDQUFDLFlBQVksQ0FBQyxJQUFJLENBQUMsQ0FBQztRQUM5QyxpQkFBWSxHQUFHLElBQUksT0FBTyxDQUFDLFlBQVksQ0FBQyxJQUFJLENBQUMsQ0FBQztRQUM5QyxTQUFJLEdBQVcsSUFBSSxDQUFDO1FBQ1osV0FBTSxHQUFVLE9BQU8sQ0FBQztRQVU1QixJQUFJLE9BQU8sR0FBRyxVQUFVLENBQUM7UUFDekIsSUFBSSxDQUFDLFlBQVksR0FBRyxVQUFVLENBQUMsWUFBWSxDQUFDO1FBQzVDLElBQUksQ0FBQyxPQUFPLEdBQUcsT0FBTyxDQUFDLE9BQU8sQ0FBQztRQUMvQixJQUFJLENBQUMsU0FBUyxHQUFHLE9BQU8s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FBQztJQUN2QixDQUFDO0lBQ0QsSUFBSSxLQUFLLENBQUMsUUFBZTtRQUNyQixFQUFFLENBQUMsQ0FBQyxRQUFRLElBQUksUUFBUSxDQUFDLENBQUEsQ0FBQztZQUN0QixJQUFJLENBQUMsTUFBTSxHQUFHLFFBQVEsQ0FBQztRQUMzQixDQUFDO1FBQUMsSUFBSSxDQUFDLENBQUM7WUFDSixPQUFPLENBQUMsU0FBUyxDQUFDLEtBQUssQ0FBQyxhQUFhLEdBQUcsUUFBUSxHQUFHLG1CQUFtQixDQUFDLENBQUM7UUFDNUUsQ0FBQztJQUNMLENBQUM7Q0FDSjtBQXBFRCxvQkFvRUMifQ==

View File

@ -8,7 +8,7 @@ class Taskchain extends taskbuffer_classes_task_1.Task {
log: false log: false
}, optionsArg, { }, optionsArg, {
taskFunction: (x) => { taskFunction: (x) => {
let done = plugins.Q.defer(); // this is the starting Deferred object let done = plugins.q.defer(); // this is the starting Deferred object
let taskCounter = 0; // counter for iterating async over the taskArray let taskCounter = 0; // counter for iterating async over the taskArray
let iterateTasks = (x) => { let iterateTasks = (x) => {
if (typeof this.taskArray[taskCounter] != "undefined") { if (typeof this.taskArray[taskCounter] != "undefined") {
@ -51,4 +51,4 @@ class Taskchain extends taskbuffer_classes_task_1.Task {
} }
exports.Taskchain = Taskchain; exports.Taskchain = Taskchain;
; ;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFza2J1ZmZlci5jbGFzc2VzLnRhc2tjaGFpbi5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3Rhc2tidWZmZXIuY2xhc3Nlcy50YXNrY2hhaW4udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLE1BQVksT0FBTyxXQUFNLHNCQUFzQixDQUFDLENBQUE7QUFDaEQsMENBQW1CLDJCQUEyQixDQUFDLENBQUE7QUFHL0Msd0JBQStCLDhCQUFJO0lBRy9CLFl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M7SUFBQSxDQUFDO0lBQ0YsVUFBVSxDQUFDLE9BQVk7UUFDbkIsTUFBTTtJQUNWLENBQUM7SUFBQSxDQUFDO0lBQ0YsU0FBUztJQUVULENBQUM7SUFBQSxDQUFDO0NBQ0w7QUF2REQsOEJBdURDO0FBQUEsQ0FBQyJ9

View File

@ -5,12 +5,12 @@ class Taskparallel extends taskbuffer_classes_task_1.Task {
constructor(optionsArg) { constructor(optionsArg) {
let options = plugins.lodash.merge(optionsArg, { let options = plugins.lodash.merge(optionsArg, {
taskFunction: () => { taskFunction: () => {
let done = plugins.Q.defer(); let done = plugins.q.defer();
let promiseArray = []; // stores promises of all tasks, since they run in parallel let promiseArray = []; // stores promises of all tasks, since they run in parallel
this.taskArray.forEach(function (taskArg) { this.taskArray.forEach(function (taskArg) {
promiseArray.push(taskArg.trigger()); promiseArray.push(taskArg.trigger());
}); });
plugins.Q.all(promiseArray) Promise.all(promiseArray)
.then(done.resolve); .then(done.resolve);
return done.promise; return done.promise;
} }
@ -20,4 +20,4 @@ class Taskparallel extends taskbuffer_classes_task_1.Task {
} }
} }
exports.Taskparallel = Taskparallel; exports.Taskparallel = Taskparallel;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFza2J1ZmZlci5jbGFzc2VzLnRhc2twYXJhbGxlbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3Rhc2tidWZmZXIuY2xhc3Nlcy50YXNrcGFyYWxsZWwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLE1BQVksT0FBTyxXQUFNLHNCQUN6QixDQUFDLENBRDhDO0FBRS9DLDBDQUFxQiwyQkFFckIsQ0FBQyxDQUYrQztBQUVoRCwyQkFBa0MsOEJBQUk7SUFFbEMsWUFBWSxVQUVYO1FBQ0csSUFBSSxPQUFPLEdBQUcsT0FBTyxDQUFDLE1BQU0sQ0FBQyxLQUFLLENBQzlCLFVBQVU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yxLQUFLLENBQzlCLFVBQVUsRUFDVjtZQUNJLFlBQVksRUFBRTtnQkFDVixJQUFJLElBQUksR0FBRyxPQUFPLENBQUMsQ0FBQyxDQUFDLEtBQUssRUFBRSxDQUFDO2dCQUM3QixJQUFJLFlBQVksR0FBbUIsRUFBRSxDQUFDLENBQUMsMkRBQTJEO2dCQUNsRyxJQUFJLENBQUMsU0FBUyxDQUFDLE9BQU8sQ0FBQyxVQUFVLE9BQU87b0JBQ3BDLFlBQVksQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLE9BQU8sRUFBRSxDQUFDLENBQUM7Z0JBQ3pDLENBQUMsQ0FBQyxDQUFBO2dCQUNGLE9BQU8sQ0FBQyxHQUFHLENBQUMsWUFBWSxDQUFDO3FCQUNwQixJQUFJLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxDQUFDO2dCQUN4QixNQUFNLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQztZQUN4QixDQUFDO1NBQ0osQ0FDSixDQUFDO1FBQ0YsS0FBSyxDQUFDLE9BQU8sQ0FBQyxDQUFDO1FBQ2YsSUFBSSxDQUFDLFNBQVMsR0FBRyxVQUFVLENBQUMsU0FBUyxDQUFDO0lBQzFDLENBQUM7Q0FDSjtBQXZCRCxvQ0F1QkMifQ==

View File

@ -2,4 +2,4 @@
class Taskspace { class Taskspace {
} }
exports.Taskspace = Taskspace; exports.Taskspace = Taskspace;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFza2J1ZmZlci5jbGFzc2VzLnRhc2tzcGFjZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3Rhc2tidWZmZXIuY2xhc3Nlcy50YXNrc3BhY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUdBO0FBRUEsQ0FBQztBQUZZLGlCQUFTLFlBRXJCLENBQUEifQ== //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFza2J1ZmZlci5jbGFzc2VzLnRhc2tzcGFjZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3RzL3Rhc2tidWZmZXIuY2xhc3Nlcy50YXNrc3BhY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUdBO0NBRUM7QUFGRCw4QkFFQyJ9

View File

@ -1,5 +1,6 @@
import "typings-global"; import "typings-global";
export import beautylog = require("beautylog"); import * as beautylog from "beautylog";
export import Q = require("q"); import * as lodash from "lodash";
export import lodash = require("lodash"); import * as rxjs from "rxjs";
export import rxjs = require("rxjs"); import * as q from 'smartq';
export { beautylog, lodash, rxjs, q };

View File

@ -1,7 +1,11 @@
"use strict"; "use strict";
require("typings-global"); require("typings-global");
exports.beautylog = require("beautylog"); const beautylog = require("beautylog");
exports.Q = require("q"); exports.beautylog = beautylog;
exports.lodash = require("lodash"); const lodash = require("lodash");
exports.rxjs = require("rxjs"); exports.lodash = lodash;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFza2J1ZmZlci5wbHVnaW5zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvdGFza2J1ZmZlci5wbHVnaW5zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxRQUFPLGdCQUNQLENBQUMsQ0FEc0I7QUFDVCxpQkFBUyxXQUFXLFdBQVcsQ0FBQyxDQUFDO0FBQ2pDLFNBQUMsV0FBVyxHQUFHLENBQUMsQ0FBQztBQUNqQixjQUFNLFdBQVUsUUFBUSxDQUFDLENBQUM7QUFDMUIsWUFBSSxXQUFXLE1BQU0sQ0FBQyxDQUFDIn0= const rxjs = require("rxjs");
exports.rxjs = rxjs;
const q = require("smartq");
exports.q = q;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidGFza2J1ZmZlci5wbHVnaW5zLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vdHMvdGFza2J1ZmZlci5wbHVnaW5zLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSwwQkFBdUI7QUFDdkIsdUNBQXNDO0FBTWxDLDhCQUFTO0FBTGIsaUNBQWdDO0FBTTVCLHdCQUFNO0FBTFYsNkJBQTRCO0FBTXhCLG9CQUFJO0FBTFIsNEJBQTJCO0FBTXZCLGNBQUMifQ==

View File

@ -25,16 +25,16 @@
"homepage": "https://gitlab.com/pushrocks/taskbuffer#readme", "homepage": "https://gitlab.com/pushrocks/taskbuffer#readme",
"dependencies": { "dependencies": {
"@types/lodash": "4.x.x", "@types/lodash": "4.x.x",
"@types/q": "0.x.x", "beautylog": "^6.0.0",
"beautylog": "^5.0.23", "lodash": "^4.17.4",
"lodash": "^4.15.0",
"q": "^1.4.1", "q": "^1.4.1",
"rxjs": "^5.0.0-beta.11", "rxjs": "^5.0.3",
"smartq": "^1.0.2",
"typings-global": "^1.0.14" "typings-global": "^1.0.14"
}, },
"devDependencies": { "devDependencies": {
"npmts-g": "^5.2.8", "npmts-g": "^5.2.10",
"should": "^11.1.0", "should": "^11.1.2",
"typings-test": "^1.0.2" "typings-test": "^1.0.3"
} }
} }

File diff suppressed because one or more lines are too long

View File

@ -1,19 +1,16 @@
import plugins = require("./taskbuffer.plugins"); import plugins = require("./taskbuffer.plugins");
import { Task, ITaskFunction } from "./taskbuffer.classes.task"; import { Task, ITaskFunction } from "./taskbuffer.classes.task";
import {Promise} from "q";
export {Promise} from "q";
export let emptyTaskFunction: ITaskFunction = function (x) { export let emptyTaskFunction: ITaskFunction = function (x) {
let done = plugins.Q.defer(); let done = plugins.q.defer();
done.resolve(); done.resolve();
return done.promise; return done.promise;
}; };
export let isTask = function (taskArg): boolean { export let isTask = function (taskArg: Task): boolean {
if ( if (
taskArg instanceof Task taskArg instanceof Task
&& typeof taskArg.task === "function" && typeof taskArg.taskFunction === "function"
) { ) {
return true; return true;
} else { } else {
@ -33,7 +30,7 @@ export let isTaskTouched = (taskArg: Task, touchedTasksArray: Task[]): boolean =
} }
export let runTask = function (taskArg: Task, optionsArg: {x?, touchedTasksArray?: Task[] }) { export let runTask = function (taskArg: Task, optionsArg: {x?, touchedTasksArray?: Task[] }) {
let done = plugins.Q.defer(); let done = plugins.q.defer();
// set running params // set running params
taskArg.running = true; taskArg.running = true;
@ -50,13 +47,13 @@ export let runTask = function (taskArg: Task, optionsArg: {x?, touchedTasksArray
touchedTasksArray.push(taskArg); touchedTasksArray.push(taskArg);
// run the task cascade // run the task cascade
let localDeferred = plugins.Q.defer(); let localDeferred = plugins.q.defer();
localDeferred.promise localDeferred.promise
.then(() => { .then(() => {
if (taskArg.preTask && !isTaskTouched(taskArg.preTask, touchedTasksArray)) { if (taskArg.preTask && !isTaskTouched(taskArg.preTask, touchedTasksArray)) {
return runTask(taskArg.preTask, {x:x, touchedTasksArray: touchedTasksArray }) return runTask(taskArg.preTask, {x:x, touchedTasksArray: touchedTasksArray })
} else { } else {
let done2 = plugins.Q.defer(); let done2 = plugins.q.defer();
done2.resolve(x); done2.resolve(x);
return done2.promise; return done2.promise;
} }
@ -68,7 +65,7 @@ export let runTask = function (taskArg: Task, optionsArg: {x?, touchedTasksArray
if (taskArg.afterTask && !isTaskTouched(taskArg.afterTask, touchedTasksArray)) { if (taskArg.afterTask && !isTaskTouched(taskArg.afterTask, touchedTasksArray)) {
return runTask(taskArg.afterTask, {x:x, touchedTasksArray: touchedTasksArray }); return runTask(taskArg.afterTask, {x:x, touchedTasksArray: touchedTasksArray });
} else { } else {
let done2 = plugins.Q.defer(); let done2 = plugins.q.defer();
done2.resolve(x); done2.resolve(x);
return done2.promise; return done2.promise;
} }
@ -85,7 +82,7 @@ export let runTask = function (taskArg: Task, optionsArg: {x?, touchedTasksArray
export interface cycleObject { export interface cycleObject {
cycleCounter:number, cycleCounter:number,
deferred:plugins.Q.Deferred<any> deferred: plugins.q.Deferred<any>
} }
export class CycleCounter { export class CycleCounter {
@ -95,7 +92,7 @@ export class CycleCounter {
this.task = taskArg; this.task = taskArg;
}; };
getPromiseForCycle(cycleCountArg:number){ getPromiseForCycle(cycleCountArg:number){
let done = plugins.Q.defer(); let done = plugins.q.defer();
let cycleObject:cycleObject = { let cycleObject:cycleObject = {
cycleCounter:cycleCountArg, cycleCounter:cycleCountArg,
deferred:done deferred:done

View File

@ -1,10 +1,6 @@
import * as plugins from "./taskbuffer.plugins" import * as plugins from "./taskbuffer.plugins"
import * as helpers from "./taskbuffer.classes.helpers" import * as helpers from "./taskbuffer.classes.helpers"
//interfaces
import {Promise} from "q";
export {Promise} from "q";
export interface ITaskFunction { export interface ITaskFunction {
(x?:any):PromiseLike<any>; (x?:any):PromiseLike<any>;
} }
@ -74,7 +70,7 @@ export class Task {
if (stateArg == "locked"){ if (stateArg == "locked"){
this._state = "locked"; this._state = "locked";
} else { } else {
plugins.beautylog.error("state type " + stateArg.blue + " could not be set"); plugins.beautylog.error("state type " + stateArg + " could not be set");
} }
} }
} }

View File

@ -20,7 +20,7 @@ export class Taskchain extends Task {
optionsArg, optionsArg,
{ {
taskFunction: (x:any) => { // this is the function that gets executed when TaskChain is triggered taskFunction: (x:any) => { // this is the function that gets executed when TaskChain is triggered
let done = plugins.Q.defer(); // this is the starting Deferred object let done = plugins.q.defer(); // this is the starting Deferred object
let taskCounter = 0; // counter for iterating async over the taskArray let taskCounter = 0; // counter for iterating async over the taskArray
let iterateTasks = (x) => { let iterateTasks = (x) => {
if(typeof this.taskArray[taskCounter] != "undefined"){ if(typeof this.taskArray[taskCounter] != "undefined"){

View File

@ -11,12 +11,12 @@ export class Taskparallel extends Task {
optionsArg, optionsArg,
{ {
taskFunction: () => { taskFunction: () => {
let done = plugins.Q.defer(); let done = plugins.q.defer();
let promiseArray:PromiseLike<any>[] = []; // stores promises of all tasks, since they run in parallel let promiseArray: Promise<any>[] = []; // stores promises of all tasks, since they run in parallel
this.taskArray.forEach(function (taskArg) { this.taskArray.forEach(function (taskArg) {
promiseArray.push(taskArg.trigger()); promiseArray.push(taskArg.trigger());
}) })
plugins.Q.all(promiseArray) Promise.all(promiseArray)
.then(done.resolve); .then(done.resolve);
return done.promise; return done.promise;
} }

View File

@ -1,5 +1,12 @@
import "typings-global" import "typings-global"
export import beautylog = require("beautylog"); import * as beautylog from "beautylog"
export import Q = require("q"); import * as lodash from "lodash"
export import lodash= require("lodash"); import * as rxjs from "rxjs"
export import rxjs = require("rxjs"); import * as q from 'smartq'
export {
beautylog,
lodash,
rxjs,
q
}