Package-level declarations

Types

Link copied to clipboard
class KTypeRef<T>

Wraps a KType instance with a generic type parameter, to ensure type-safe usages.

Link copied to clipboard

A StompSession with additional methods to serialize/deserialize message bodies based on a KClass.

Functions

Link copied to clipboard
inline suspend fun <T> TypedStompSession.convertAndSend(destination: String, body: T): StompReceipt?

Sends a SEND frame to the server at the given destination with the given body, converted appropriately.

inline suspend fun <T> TypedStompSession.convertAndSend(headers: StompSendHeaders, body: T): StompReceipt?

Sends a SEND frame to the server with the given headers and body, converted appropriately.

Link copied to clipboard
inline suspend fun <T> TypedStompSession.subscribe(destination: String): Flow<T>

Subscribes to the given destination and returns a Flow of messages of type T that unsubscribes automatically when the collector is done or cancelled. The returned flow can be collected only once.

Link copied to clipboard
inline fun <T> typeRefOf(): KTypeRef<T>

Creates a KTypeRef representing the given type T.