amis-rpc-design/node_modules/fork-ts-checker-webpack-plugin/lib/utils/async/pool.d.ts

11 lines
365 B
TypeScript
Raw Normal View History

2023-10-07 19:42:30 +08:00
import type { AbortSignal } from 'node-abort-controller';
declare type Task<T> = (signal?: AbortSignal) => Promise<T>;
interface Pool {
submit<T>(task: Task<T>, signal?: AbortSignal): Promise<T>;
size: number;
readonly pending: number;
readonly drained: Promise<void>;
}
declare function createPool(size: number): Pool;
export { Pool, createPool };