RpcNotificationsLocalPoll

Implementation for RpcNotifications that also implements RpcPoll interface to handle long poll method for notification propagation.

Constructors

Link copied to clipboard
constructor(cipher: SimpleCipher)

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard
open suspend override fun emit(target: String, state: DataItem, notification: DataItem)

Sends a notification to a target.

Link copied to clipboard
open suspend override fun poll(consumeToken: String, pollKeys: List<RpcPoll.PollKey>): RpcPoll.PollResult

Waits for an event/notification on one of the specified poll keys. If the wait exceeds certain implementation-specific duration TimeoutException is thrown. Otherwise the index of the receiving poll and notification payload is returned. In addition, consumeToken passed to the next poll call serves as an indication that the notification was processed by the caller and should not be returned again.