/** * Concurrency Manager / 并发管理器 * Manages concurrent execution limits for background tasks by model/provider * 按模型/提供者管理后台任务的并发执行限制 */ import type { BackgroundTaskConfig } from "./types"; export declare class ConcurrencyManager { private counts; private queues; private readonly defaultConcurrency; private readonly providerConcurrency; private readonly modelConcurrency; /** * Initialize concurrency manager with configuration * 使用配置初始化并发管理器 */ constructor(config?: BackgroundTaskConfig); /** * Get concurrency limit for a specific model * 获取特定模型的并发限制 */ getConcurrencyLimit(model: string): number; /** * Acquire a concurrency slot for the given model * 为给定模型获取一个并发槽位 */ acquire(model: string): Promise; /** * Release a concurrency slot for the given model * 释放给定模型的并发槽位 */ release(model: string): void; /** * Cancel all waiting tasks for the given model * 取消给定模型的所有等待任务 */ cancelWaiters(model: string): void; }