Package-level declarations

Client module of Ktor WS Events project - Event delivery extensions for Ktor (Server/Client) over WebSocket protocol.

Types

Link copied to clipboard
@Serializable
data class ClientWebSocketEvent<T>(val id: Identifier, val reference: EventReference, val initiated: UnixTime, val data: T) : AbstractEvent

Properties

Link copied to clipboard
val EventReceiverLog: KmLog
Link copied to clipboard
val EventReceivingScope: CoroutineScope
Link copied to clipboard

Functions

Link copied to clipboard
inline suspend fun <T> DefaultClientWebSocketSession.receiveWebSocketEvent(): ClientWebSocketEvent<T>

Dequeues a frame containing ClientWebSocketEvent and tries to deserialize it.

Link copied to clipboard
inline suspend fun <T> DefaultClientWebSocketSession.receiveWebSocketEvents(crossinline receiver: suspend (ClientWebSocketEvent<T>) -> Unit): Job

Dequeues frames containing ClientWebSocketEvent and tries to deserialize it. Will retry if something went wrong while receiving a frame.

Link copied to clipboard
suspend fun HttpClient.webSocketEvents(reference: EventReference, path: String = Routes.DEFAULT_EVENTS_ROUTE, block: suspend DefaultClientWebSocketSession.() -> Unit)

Opens a block with DefaultClientWebSocketSession associated with the given event reference and optional path.

Link copied to clipboard
suspend fun <R> withRetries(continuous: Boolean = false, onError: suspend (Throwable) -> Unit = {}, block: suspend () -> R)