X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;ds=inline;f=src%2Fqueue.ts;h=baecaa35b248d98a6cd4d378b444cfe2a4d316f2;hb=df593701c4bd494b0e99372fdcc3708412799942;hp=7aad6d065ce6338129c70032b266ce5c6bcba600;hpb=e3347a5c81590368f590783d9afe979dada9f555;p=poolifier.git diff --git a/src/queue.ts b/src/queue.ts index 7aad6d06..baecaa35 100644 --- a/src/queue.ts +++ b/src/queue.ts @@ -64,4 +64,14 @@ export class Queue { } return this.items[this.offset] } + + /** + * Clear the queue. + */ + public clear (): void { + this.items = [] + this.offset = 0 + this.size = 0 + this.maxSize = 0 + } }