Remove redundant await
[poolifier.git] / src / pools / thread / fixed.ts
index abd1b6b8b081ac2740ac96ea6a1265a690ff407b..e3f9602cd93cdfc3a3e03b3ab7860fe25cdb5135 100644 (file)
@@ -16,9 +16,8 @@ export type ThreadWorkerWithMessageChannel = Worker & Draft<MessageChannel>
  *
  * This pool selects the threads in a round robin fashion.
  *
- * @template Data Type of data sent to the worker. This can only be serializable data.
- * @template Response Type of response of execution. This can only be serializable data.
- *
+ * @template DataType of data sent to the worker. This can only be serializable data.
+ * @template ResponseType of response of execution. This can only be serializable data.
  * @author [Alessandro Pio Ardizio](https://github.com/pioardi)
  * @since 0.0.1
  */
@@ -31,7 +30,7 @@ export class FixedThreadPool<
    *
    * @param numberOfThreads Number of threads for this pool.
    * @param filePath Path to an implementation of a `ThreadWorker` file, which can be relative or absolute.
-   * @param opts Options for this fixed thread pool. Default: `{}`
+   * @param [opts={}] Options for this fixed thread pool.
    */
   public constructor (
     numberOfThreads: number,
@@ -41,6 +40,7 @@ export class FixedThreadPool<
     super(numberOfThreads, filePath, opts)
   }
 
+  /** @inheritdoc */
   protected isMain (): boolean {
     return isMainThread
   }
@@ -53,6 +53,7 @@ export class FixedThreadPool<
     await worker.terminate()
   }
 
+  /** @inheritdoc */
   protected sendToWorker (
     worker: ThreadWorkerWithMessageChannel,
     message: MessageValue<Data>
@@ -68,12 +69,14 @@ export class FixedThreadPool<
     messageChannel.port2?.on('message', listener)
   }
 
+  /** @inheritdoc */
   protected createWorker (): ThreadWorkerWithMessageChannel {
     return new Worker(this.filePath, {
       env: SHARE_ENV
     })
   }
 
+  /** @inheritdoc */
   protected afterWorkerSetup (worker: ThreadWorkerWithMessageChannel): void {
     const { port1, port2 } = new MessageChannel()
     worker.postMessage({ parent: port1 }, [port1])