2 * Contract definition for a poolifier pool.
4 * @template Data Type of data sent to the worker.
5 * @template Response Type of response of execution.
7 export interface IPool
<Data
= unknown
, Response
= unknown
> {
9 * Perform the task specified in the constructor with the data parameter.
11 * @param data The input for the specified task.
12 * @returns Promise that will be resolved when the task is successfully completed.
14 execute(data
: Data
): Promise
<Response
>
16 * Shut down every current worker in this pool.
18 destroy(): Promise
<void>