Subscription

expect class Subscription : IncomingMessageSubscription
actual class Subscription : IncomingMessageSubscription
actual class Subscription : IncomingMessageSubscription

Contains information about an active incoming message subscription with signald.

Functions

Link copied to clipboard
expect open override fun close()
actual open override fun close()
actual open override fun close()
Link copied to clipboard
abstract fun nextMessage(): ClientMessageWrapper?
open override fun nextMessage(): ClientMessageWrapper?
open override fun nextMessage(): ClientMessageWrapper?

Parses an incoming message from the socket. If this returns null, then the socket is closed / reached EOF. This will block the current thread if it has to wait for messages.

Link copied to clipboard
abstract suspend fun nextMessageSuspend(): ClientMessageWrapper?
open suspend override fun nextMessageSuspend(): ClientMessageWrapper?

Parses an incoming message from the socket. If this returns null, then the socket is closed / reached EOF. This will suspend if it has to wait for messages.

open suspend override fun nextMessageSuspend(): ClientMessageWrapper?
Link copied to clipboard
suspend fun unsubscribe(): SubscriptionResponse
fun unsubscribe(): SubscriptionResponse

Properties

Link copied to clipboard
expect val accountId: String
actual val accountId: String
actual val accountId: String
Link copied to clipboard
abstract val initialMessagesCount: Int

The number of messages sent while we were waiting for signald's response to the subscribe request. This is currently used for detecting such a situation.

Link copied to clipboard
open override val initialMessagesCount: Int

The number of messages sent while we were waiting for signald's response to the subscribe.

Link copied to clipboard
open override val initialMessagesCount: Int

The number of messages sent while we were waiting for signald's response to the subscribe.