update taskbuffer and add gitlab ci
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user