Add stop command (#540)

Co-authored-by: Max Isom <hi@maxisom.me>
This commit is contained in:
Thongrapee Panyapatiphan 2022-02-25 06:24:45 +07:00 committed by GitHub
parent 237086245b
commit 4f0db62170
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 47 additions and 0 deletions

View file

@ -342,6 +342,12 @@ export default class {
return this.queueSize() === 0;
}
stop(): void {
this.disconnect();
this.queuePosition = 0;
this.queue = [];
}
private getHashForCache(url: string): string {
return hasha(url);
}