update taskbuffer and add gitlab ci

This commit is contained in:
2016-08-01 13:17:15 +02:00
parent 8a414b9a7d
commit 24e96926e3
16 changed files with 257 additions and 103 deletions

View File

@@ -1,19 +1,19 @@
import * as plugins from "./taskbuffer.plugins"
import * as helpers from "./taskbuffer.classes.helpers"
import {Task} from "./taskbuffer.classes.task"
import { Task } from "./taskbuffer.classes.task"
export class Taskparallel extends Task {
taskArray:Task[];
constructor(optionsArg:{
taskArray:Task[]
taskArray: Task[];
constructor(optionsArg: {
taskArray: Task[]
}){
let options = plugins.lodash.assign(
let options = plugins.lodash.merge(
optionsArg,
{
taskFunction:() => {
taskFunction: () => {
let done = plugins.Q.defer();
let promiseArray; // stores promises of all tasks, since they run in parallel
this.taskArray.forEach(function(taskArg:Task){
let promiseArray:PromiseLike<any>[] = []; // stores promises of all tasks, since they run in parallel
this.taskArray.forEach(function (taskArg) {
promiseArray.push(taskArg.trigger());
})
plugins.Q.all(promiseArray)
@@ -21,8 +21,9 @@ export class Taskparallel extends Task {
return done.promise;
}
}
)
);
super(options);
this.taskArray = optionsArg.taskArray;
}
}