/** * AsyncQueue is a bounded queue with async support for both producers and consumers. * * This queue simplifies the AudioMixer implementation by handling backpressure and * synchronization automatically: * - Producers can await put() until the queue has space (when queue is full) * - Consumers can await waitForItem() until data is available (when queue is empty) * * This eliminates the need for manual coordination logic, polling loops, and * complex state management throughout the rest of the codebase. */ declare class AsyncQueue { private capacity; private items; private waitingProducers; private waitingConsumers; closed: boolean; constructor(capacity?: number); put(item: T): Promise; get(): T | undefined; /** * Wait until an item is available or the queue is closed. * Returns immediately if items are already available. */ waitForItem(): Promise; close(): void; get length(): number; } export { AsyncQueue };