import type { SimEvent } from '../../types/events.ts'; import { ComponentType } from '../../types/components.ts'; import type { SimComponent, SimContext, ComponentConfig, ComponentMetrics } from '../../types/components.ts'; import type { QueueConfig } from '../../types/configs.ts'; /** * Queue component: buffers work units in FIFO order with configurable * capacity limits and load-shedding behavior. * * Validates: Requirements 5.1, 5.2, 5.3, 5.4, 5.5 */ export declare class Queue implements SimComponent { readonly id: string; readonly type = ComponentType.QUEUE; readonly config: ComponentConfig; private queueConfig; private buffer; private bufferHead; private inFlightCount; private pendingOrigins; private totalEnqueued; private totalDequeued; private totalRejected; constructor(id: string, queueConfig: QueueConfig); /** * Process an incoming event. * * 'arrival': Check capacity/load-shedding → reject or enqueue. * 'departure': Forward response to origin, dequeue next and send downstream. */ handleEvent(event: SimEvent, context: SimContext): SimEvent[]; /** * Handle an arrival: reject if full or load-shedding threshold exceeded, * otherwise enqueue and forward to downstream if idle. */ /** Logical length of the FIFO buffer (excludes already-dequeued head elements) */ private get bufferLength(); private handleArrival; /** * Handle a departure from downstream: forward response to origin, * then dequeue and send next item downstream. */ private handleDeparture; /** * Dequeue the next item (FIFO: front, LIFO: back) and send it as an arrival * to the downstream component. * Respects maxConcurrency: won't send if already at the in-flight limit. */ private sendNextToDownstream; /** * Record the current queue depth metric (Req 5.5). */ private recordQueueDepth; /** Return current metrics snapshot */ getMetrics(): ComponentMetrics; /** Reset component to initial state */ reset(): void; } //# sourceMappingURL=queue.d.ts.map