Some checks failed
Publish Swift Package / build-test-publish (push) Failing after 3m27s
Co-Authored-By: Lilith Autocommit <noreply@atlilith.com>
29 lines
897 B
Swift
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
|
|
}
|