import type { Batch } from "./batch"; import type { Sender } from "./sender"; /** * 简单的异步发送线程池,实现基于 MaxSenderCount 的并发控制。 */ export declare class ThreadPool { private readonly sender; private readonly maxConcurrency; private queue; private activeCount; private stopped; private forceQuit; private stopResolve?; constructor(sender: Sender, maxConcurrency: number); /** * 提交一个批次到线程池中异步发送。 */ submit(batch: Batch | undefined | null): void; /** * 优雅关闭:等待队列消费完且所有发送任务结束。 */ stopGracefully(): Promise; /** * 强制关闭:清空待发送队列,不再等待未完成任务。 */ stopForce(): void; private drain; }