@gati-framework/runtime
Version:
Gati runtime execution engine for running handler-based applications
32 lines • 1.02 kB
TypeScript
/**
* @module runtime/websocket-coordinator
* @description WebSocket event coordinator for request synchronization
*/
export interface WebSocketEvent {
type: string;
requestId: string;
data?: unknown;
timestamp: number;
}
export interface WebSocketCoordinator {
/**
* Wait for a specific event related to a request
*/
waitForEvent(requestId: string, eventType: string, timeout?: number): Promise<WebSocketEvent>;
/**
* Emit an event for a specific request
*/
emitEvent(event: WebSocketEvent): void;
/**
* Clean up listeners for a request
*/
cleanup(requestId: string): void;
}
export declare class DefaultWebSocketCoordinator implements WebSocketCoordinator {
private emitter;
private pendingRequests;
waitForEvent(requestId: string, eventType: string, timeout?: number): Promise<WebSocketEvent>;
emitEvent(event: WebSocketEvent): void;
cleanup(requestId: string): void;
}
//# sourceMappingURL=websocket-coordinator.d.ts.map