/** * Central message queue for the conductor * * All routing flows through this queue, preserving message ordering. * The queue supports async iteration, allowing the conductor's main loop * to consume messages as they arrive. */ import type { ConductorMessage } from "./types.js"; /** * A message queue with async iteration support. * * Messages can be pushed from multiple sources (client, proxies, agent) * and are consumed in order by the conductor's event loop. */ export declare class MessageQueue { private queue; private resolvers; private closed; /** * Push a message onto the queue. * * If there's a waiting consumer, the message is delivered immediately. * Otherwise, it's buffered until the next consumer is ready. */ push(message: ConductorMessage): void; /** * Close the queue, causing the async iterator to complete. */ close(): void; /** * Check if the queue has been closed */ isClosed(): boolean; /** * Async iterator for consuming messages. * * This allows the conductor to use `for await` to process messages: * ```typescript * for await (const msg of messageQueue) { * await handleMessage(msg); * } * ``` */ [Symbol.asyncIterator](): AsyncIterator; } //# sourceMappingURL=message-queue.d.ts.map