} from '../utils'
import { Deque } from '../deque'
import {
+ type BackPressureCallback,
+ type EmptyQueueCallback,
type IWorker,
type IWorkerNode,
type WorkerInfo,
type WorkerUsage
} from './worker'
-type EmptyQueueCallback = (workerId: number) => void
-type BackPressureCallback = EmptyQueueCallback
-
/**
* Worker node.
*
readonly once: (event: 'exit', handler: ExitHandler<this>) => void
}
+export type EmptyQueueCallback = (workerId: number) => void
+export type BackPressureCallback = EmptyQueueCallback
+
/**
* Worker node interface.
*
*
* @param workerId - The worker id.
*/
- onBackPressure?: (workerId: number) => void
+ onBackPressure?: EmptyQueueCallback
/**
* Callback invoked when worker node tasks queue is empty.
*
* @param workerId - The worker id.
*/
- onEmptyQueue?: (workerId: number) => void
+ onEmptyQueue?: BackPressureCallback
/**
* Tasks queue size.
*