RpcPoll

interface RpcPoll

An interface to represent a long poll.

Inheritors

Types

Link copied to clipboard
object Companion
Link copied to clipboard
data class PollKey(val target: String, val opaqueState: DataItem)
Link copied to clipboard
data class PollResult(val consumeToken: String, val index: Int, val notification: DataItem)
Link copied to clipboard

Functions

Link copied to clipboard
abstract suspend 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.