import type { Worker } from 'node:cluster'
-import type { MessagePort } from 'node:worker_threads'
import { performance } from 'node:perf_hooks'
+import type { MessagePort } from 'node:worker_threads'
+
import type {
MessageValue,
Task,
isAsyncFunction,
isPlainObject
} from '../utils.js'
-import { KillBehaviors, type WorkerOptions } from './worker-options.js'
import type {
TaskAsyncFunction,
TaskFunction,
checkValidTaskFunctionEntry,
checkValidWorkerOptions
} from './utils.js'
+import { KillBehaviors, type WorkerOptions } from './worker-options.js'
const DEFAULT_MAX_INACTIVE_TIME = 60000
const DEFAULT_WORKER_OPTIONS: WorkerOptions = {
})
return undefined
})
- .catch(error => {
+ .catch((error: unknown) => {
this.sendToMainWorker({
workerError: {
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion