Only allow primitive JSON for transfer between worker and main worker (#128)
[poolifier.git] / src / pools / cluster / dynamic.ts
index f2375a02d6e1babf875d27b40f01782849828af0..25306d34215b396bb5f06e2ab740dd11c9379dd3 100644 (file)
@@ -1,5 +1,5 @@
 import type { Worker } from 'cluster'
-import type { MessageValue } from '../../utility-types'
+import type { JSONValue, MessageValue } from '../../utility-types'
 import type { ClusterPoolOptions } from './fixed'
 import { FixedClusterPool } from './fixed'
 
@@ -13,10 +13,8 @@ import { FixedClusterPool } from './fixed'
  * @since 2.0.0
  */
 export class DynamicClusterPool<
-  // eslint-disable-next-line @typescript-eslint/no-explicit-any
-  Data = any,
-  // eslint-disable-next-line @typescript-eslint/no-explicit-any
-  Response = any
+  Data extends JSONValue = JSONValue,
+  Response extends JSONValue = JSONValue
 > extends FixedClusterPool<Data, Response> {
   /**
    * @param min Min number of workers that will be always active