Extractor.stop()

This commit is contained in:
2020-01-15 14:18:31 +08:00
parent 2224db1ad1
commit da7ae057f4
3 changed files with 40 additions and 6 deletions

View File

@ -51,14 +51,19 @@ export class Extractor {
/**
* Start the task chain.
*/
async start() {
start() {
return this._startTasks(0);
}
stop() {
for (let i = 0; i < this._tasks.length; i++) {
this._tasks[i].stop();
}
}
/**
* restart from specified task, but don't restart the previous tasks.
* @param {number} from where to restart the tasks, begins with 0
*/
async restart(from: number = 0) {
restart(from: number = 0) {
let id = this._checkTaskId(from, 0);
if (id < 0) return;
for (let i = id; i < this._tasks.length; i++) {