lilith-messaging-api-client/Sources/MessagingAPIClient/WebSocket/ConnectionState.swift
Natalie ac0d0898d5
Some checks failed
Publish Swift Package / build-test-publish (push) Failing after 3m27s
feat(@api-client): add web socket and rest client support
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
2026-04-15 01:16:47 -07:00

29 lines
897 B
Swift

import Foundation
// MARK: - WebSocket Connection State
/// Represents the current state of the WebSocket connection lifecycle.
///
/// State transitions:
/// ```
/// disconnected -> connecting -> connected
/// |
/// v
/// reconnecting -> connecting -> connected
/// |
/// v
/// disconnected (after max retries or explicit disconnect)
/// ```
public enum WSConnectionState: String, Sendable, Hashable {
/// Not connected to the server.
case disconnected
/// Actively establishing a connection.
case connecting
/// Connected and ready to send/receive events.
case connected
/// Connection lost; attempting automatic reconnection with exponential backoff.
case reconnecting
}