subscribe And Consume Blocking
fun subscribeAndConsumeBlocking(messageConsumer: (ClientMessageWrapper) -> Unit)
Content copied to clipboard
Subscribes to incoming messages and consumes them on the thread that called this function. This will open a dedicated, persistent socket connection for this function call. The current thread will be blocked when it waits for more messages. After this function executes, an unsubscribe request will be made and the persistent socket will be closed.
Throws
org.inthewaves.kotlinsignald.clientprotocol.RequestFailedException
if the subscribe request fails
org.inthewaves.kotlinsignald.clientprotocol.SignaldException
if an I/O error occurs when communicating to the socket