Skip to content

[feature] be able to run multiple tasks in separate threads #527

Description

@gabrielcsapo

Motivation

Looking at the runTasks function, there is some room for improvement on systems that have multiple cores. Tasks could be threaded off using something like https://www.npmjs.com/package/piscina.

async runTasks(): Promise<[TaskResult[], TaskError[]]> {
let results = await this.eachTask(async (task: Task) => {
let result;
this.debug('start %s run', task.constructor.name);
try {
result = await task.run();
} catch (error) {
this.addError(task.meta.taskName, error.message);
}
this.debug('%s run done', task.constructor.name);
return result;
});
return [(results.filter(Boolean) as TaskResult[]).sort(taskResultComparator), this._errors];
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions