fix: prepare code to fix pool internal IPC for cluster worker
[poolifier.git] / src / queue.ts
index baecaa35b248d98a6cd4d378b444cfe2a4d316f2..e7c9dd11fc0332ccbba845e9bd663d4bc682c523 100644 (file)
@@ -6,18 +6,15 @@
  * @typeParam T - Type of queue items.
  */
 export class Queue<T> {
-  private items: T[]
-  private offset: number
-  public size: number
-  public maxSize: number
+  private items!: T[]
+  private offset!: number
+  /** The size of the queue. */
+  public size!: number
+  /** The maximum size of the queue. */
+  public maxSize!: number
 
   public constructor () {
-    this.items = []
-    this.offset = 0
-    /** The size of the queue. */
-    this.size = 0
-    /** The maximum size of the queue. */
-    this.maxSize = 0
+    this.clear()
   }
 
   /**