fix: add maximum tasks queue size to worker usage data
[poolifier.git] / src / queue.ts
index 7aad6d065ce6338129c70032b266ce5c6bcba600..baecaa35b248d98a6cd4d378b444cfe2a4d316f2 100644 (file)
@@ -64,4 +64,14 @@ export class Queue<T> {
     }
     return this.items[this.offset]
   }
+
+  /**
+   * Clear the queue.
+   */
+  public clear (): void {
+    this.items = []
+    this.offset = 0
+    this.size = 0
+    this.maxSize = 0
+  }
 }