+export interface IPool<
+ Worker extends IWorker,
+ Data = unknown,
+ Response = unknown
+> {
+ /**
+ * Pool type.
+ *
+ * If it is `'dynamic'`, it provides the `max` property.
+ */
+ readonly type: PoolType
+ /**
+ * Pool worker nodes.
+ */
+ readonly workerNodes: Array<WorkerNode<Worker, Data>>
+ /**
+ * Emitter on which events can be listened to.
+ *
+ * Events that can currently be listened to:
+ *
+ * - `'full'`: Emitted when the pool is dynamic and full.
+ * - `'busy'`: Emitted when the pool is busy.
+ */
+ readonly emitter?: PoolEmitter
+ /**
+ * Finds a free worker node key based on the number of tasks the worker has applied.
+ *
+ * If a worker is found with `0` running tasks, it is detected as free and its worker node key is returned.
+ *
+ * If no free worker is found, `-1` is returned.
+ *
+ * @returns A worker node key if there is one, `-1` otherwise.
+ */
+ findFreeWorkerNodeKey: () => number