import type { BackgroundTaskConfig } from "../../config/schema"; export declare class ConcurrencyManager { private config?; private counts; private queues; constructor(config?: BackgroundTaskConfig); getConcurrencyLimit(model: string): number; getConcurrencyKey(model: string): string; /** * Non-blocking acquire: takes a slot immediately when one is free. * Returns true when a slot was taken, false when the group is full (in * which case nothing is held and the caller decides whether to queue). */ tryAcquire(model: string): boolean; acquire(model: string, taskId?: string): Promise; release(model: string): void; /** * Cancel a specific task's waiter in the queue for a model. * Returns true if a matching waiter was found and cancelled. */ cancelWaiter(model: string, taskId: string): boolean; /** * Cancel all waiting acquires for a model. Used during cleanup. */ cancelWaiters(model: string): void; /** * Clear all state. Used during manager cleanup/shutdown. * Cancels all pending waiters. */ clear(): void; /** * Get current count for a model (for testing/debugging) */ getCount(model: string): number; /** * Get queue length for a model (for testing/debugging) */ getQueueLength(model: string): number; }