Use github event in github action
[poolifier.git] / src / worker / abstract-worker.ts
index 9ec38feda57cdccc6cde6598943c2b157e439ed4..54358ee64b58adfb1a4f9275f53a04185ea878e8 100644 (file)
@@ -84,7 +84,7 @@ export abstract class AbstractWorker<
   ): void {
     if (value.data !== undefined && value.id !== undefined) {
       // Here you will receive messages
-      if (this.opts.async) {
+      if (this.opts.async === true) {
         this.runInAsyncScope(this.runAsync.bind(this), this, fn, value)
       } else {
         this.runInAsyncScope(this.run.bind(this), this, fn, value)
@@ -104,9 +104,6 @@ export abstract class AbstractWorker<
     this.opts.killBehavior = opts.killBehavior ?? DEFAULT_KILL_BEHAVIOR
     this.opts.maxInactiveTime =
       opts.maxInactiveTime ?? DEFAULT_MAX_INACTIVE_TIME
-    /**
-     * Whether the worker is working asynchronously or not.
-     */
     this.opts.async = !!opts.async
   }
 
@@ -139,7 +136,7 @@ export abstract class AbstractWorker<
   protected abstract sendToMainWorker (message: MessageValue<Response>): void
 
   /**
-   * Check to see if the worker should be terminated, because its living too long.
+   * Checks if the worker should be terminated, because its living too long.
    */
   protected checkAlive (): void {
     if (