Skip to content

bodhi-realtime-agent / ConnectionLifecycleEvent

Type Alias: ConnectionLifecycleEvent ​

ConnectionLifecycleEvent = { connectAttemptId: string; handleSupplied: boolean; kind: "attempt"; } | { connectAttemptId: string; kind: "setup-ok"; meta?: unknown; transportGeneration: number; } | { connectAttemptId: string; failure?: ConnectFailure; kind: "setup-failed"; meta?: unknown; reason?: string; } | { code?: number; connectAttemptId: string; failure?: ConnectFailure; kind: "attempt-close"; meta?: unknown; reason?: string; } | { code?: number; connectAttemptId: string; kind: "generation-close"; meta?: unknown; reason?: string; transportGeneration: number; }

Defined in: src/types/transport.ts:482

Connection-lifecycle facts, one event per observable transition.

Variants are split rather than made optional because transportGeneration is minted only on successful setup: a socket that dies BEFORE setupComplete has no generation, and a single close variant requiring one could not represent exactly the failures these events exist to preserve. A consumer correlates by connectAttemptId; more than one event can describe one attempt (e.g. attempt-close followed by setup-failed).

Built with VitePress