Messages

Defines the core APIs to send and retrieve messages.

Functions

Link copied to clipboard
@JvmName(name = "verifyRetrievedMessage")
fun Messages.blockingVerifyRetrievedMessage(messageId: Int)

Blocking-call variant of Messages.verifyRetrievedMessage.

Link copied to clipboard
abstract fun createMessageChannel(messages: Flow<Message>): Flow<ErrorPayload>

Creates a channel for sending messages to hub-server. Even though, the channel is bidirectional, the response is empty in case of success and only in cases of error values are emitted in stream.

Link copied to clipboard
Link copied to clipboard
abstract fun createRejectedMessageChannel(messages: Flow<RejectedMessage>): Flow<ErrorPayload>

Creates a channel for sending rejected messages to hub-server. Even though, the channel is bidirectional, the response is empty in case of success and only in cases of error values are emitted in stream.

Link copied to clipboard

Retrieves a stream of incoming messages which are meant for this server-client.

Link copied to clipboard
fun <T> HubClientCoroutineContextStrategy.runBlockingWithContext(block: suspend CoroutineScope.() -> T): T

Runs a new coroutine in HubClientCoroutineContextStrategy.clientCoroutineContext context and blocks the current thread until its completion. This function should not be used from a coroutine.

Link copied to clipboard
suspend fun Messages.streamMessages(messages: Flow<Message>)

Streams messages to hub-server.

fun Messages.streamMessages(messages: Flux<Message>)

Flux variant of Messages.streamMessages.

Link copied to clipboard
abstract suspend fun verifyRetrievedMessage(messageId: Int)

Verifies the message with associated messageId is retrieved successful.

Properties

Link copied to clipboard

The hubClient's-coroutine-context. It can be used to explicit define in which CoroutineContext the new client will run.