Package org.inthewaves.kotlinsignald.subscription
Types
Creates a Channel-based message handler. Messages can be received by receiving elements from the messages. Unsubscription and closing of the socket is handled by calling close or cancelling the given coroutineScope
.
An abstract incoming message subscription handler that uses a coroutine to handle the event loop for messages.
Creates a SharedFlow-based message handler by creating a new socket connection and sending a subscribe request. Messages can be received by collecting from the messages flow. Unsubscription and closing of the socket is handled by calling close or cancelling the given coroutineScope. This is suitable for when multiple subscribers to incoming messages are desired.
Functions
Launches a new coroutine that uses the signaldClient to create a new socket connection and using the socket to subscribe to incoming messages from signald. The incoming messages are sent through the returned ReceiveChannel.
Launches a new coroutine that uses the IncomingMessageSubscription to handle incoming messages from signald. The incoming messages are emitted in the returned SharedFlow.