mirror of
https://github.com/codedread/bitjs
synced 2025-10-06 10:49:55 +02:00
Add ability to stop an Unarchiver and terminate its worker
This commit is contained in:
parent
a2298d361b
commit
de1bc5243c
1 changed files with 11 additions and 1 deletions
10
archive.js
10
archive.js
|
@ -305,7 +305,17 @@ bitjs.archive.Unarchiver.prototype.handleWorkerEvent_ = function(e) {
|
||||||
|
|
||||||
this.worker_.postMessage({file: this.ab});
|
this.worker_.postMessage({file: this.ab});
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Terminates the Web Worker for this Unarchiver and returns immediately.
|
||||||
|
*/
|
||||||
|
bitjs.archive.Unarchiver.prototype.stop = function() {
|
||||||
|
if (this.worker_) {
|
||||||
|
this.worker_.terminate();
|
||||||
}
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Unzipper
|
* Unzipper
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue