mirror of
https://github.com/codedread/bitjs
synced 2025-10-06 02:39: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
12
archive.js
12
archive.js
|
@ -305,7 +305,17 @@ bitjs.archive.Unarchiver.prototype.handleWorkerEvent_ = function(e) {
|
|||
|
||||
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue