build: silence type warnings
authorJérôme Benoit <jerome.benoit@piment-noir.org>
Fri, 13 Oct 2023 20:15:31 +0000 (22:15 +0200)
committerJérôme Benoit <jerome.benoit@piment-noir.org>
Fri, 13 Oct 2023 20:15:31 +0000 (22:15 +0200)
Signed-off-by: Jérôme Benoit <jerome.benoit@piment-noir.org>
src/pools/abstract-pool.ts

index a0fc76c371584d3e69855fe732d720db482cc0bf..bec4cd29056f4bf531e5f267e767795d4a1753b0 100644 (file)
@@ -622,7 +622,7 @@ export abstract class AbstractPool<
     for (const [workerNodeKey] of this.workerNodes.entries()) {
       this.workerNodes[workerNodeKey].addEventListener(
         'emptyqueue',
-        this.handleEmptyQueueEvent
+        this.handleEmptyQueueEvent as EventListener
       )
     }
   }
@@ -631,7 +631,7 @@ export abstract class AbstractPool<
     for (const [workerNodeKey] of this.workerNodes.entries()) {
       this.workerNodes[workerNodeKey].removeEventListener(
         'emptyqueue',
-        this.handleEmptyQueueEvent
+        this.handleEmptyQueueEvent as EventListener
       )
     }
   }
@@ -640,7 +640,7 @@ export abstract class AbstractPool<
     for (const [workerNodeKey] of this.workerNodes.entries()) {
       this.workerNodes[workerNodeKey].addEventListener(
         'backpressure',
-        this.handleBackPressureEvent
+        this.handleBackPressureEvent as EventListener
       )
     }
   }
@@ -649,7 +649,7 @@ export abstract class AbstractPool<
     for (const [workerNodeKey] of this.workerNodes.entries()) {
       this.workerNodes[workerNodeKey].removeEventListener(
         'backpressure',
-        this.handleBackPressureEvent
+        this.handleBackPressureEvent as EventListener
       )
     }
   }
@@ -1366,13 +1366,13 @@ export abstract class AbstractPool<
       if (this.opts.tasksQueueOptions?.taskStealing === true) {
         this.workerNodes[workerNodeKey].addEventListener(
           'emptyqueue',
-          this.handleEmptyQueueEvent
+          this.handleEmptyQueueEvent as EventListener
         )
       }
       if (this.opts.tasksQueueOptions?.tasksStealingOnBackPressure === true) {
         this.workerNodes[workerNodeKey].addEventListener(
           'backpressure',
-          this.handleBackPressureEvent
+          this.handleBackPressureEvent as EventListener
         )
       }
     }