Linting
[poolifier.git] / src / worker / abstract-worker.ts
index c50cfbb081599ed955561edea56a634c93d885ef..cb33188e5778a3c9a31cc30f6ae93cb46b33567c 100644 (file)
@@ -1,12 +1,13 @@
 import { AsyncResource } from 'async_hooks'
 import type { Worker } from 'cluster'
 import type { MessagePort } from 'worker_threads'
-import type { MessageValue } from '../utility-types'
+import type { MessageValue, KillBehavior } from '../utility-types'
 import type { WorkerOptions } from './worker-options'
-import { killBehaviorEnumeration } from './worker-options'
+// import { killBehaviorEnumeration } from './worker-options'
 
 const defaultMaxInactiveTime = 1000 * 60
-const defaultKillBehavior = killBehaviorEnumeration.SOFT
+// TODO fix this and avoid that SOFT/HARD words are replicated so much times into the project
+const defaultKillBehavior: KillBehavior = 'SOFT'
 
 /**
  * Base class containing some shared logic for all poolifier workers.
@@ -27,7 +28,7 @@ export abstract class AbstractWorker<
   /**
    * The kill behavior set as option on the Worker constructor or a default value.
    */
-  protected readonly killBehavior: string
+  protected readonly killBehavior: KillBehavior
   /**
    * Whether the worker is working asynchronously or not.
    */