Polling

Public facade instance for consumers. Delegates to the internal engine.

This is the single entry-point to start, control, and run polling operations.

Functions

Link copied to clipboard
open override fun activePollsCount(): Int

Number of active polling sessions.

Link copied to clipboard
open suspend override fun cancel(session: PollingSession)

Cancel a session using the session handle.

open suspend override fun cancel(id: String)

Cancel a session by ID.

Link copied to clipboard
open suspend override fun cancelAll()

Cancel all active sessions.

Link copied to clipboard
open suspend override fun <T> compose(vararg configs: PollingConfig<T>): PollingOutcome<T>

Compose multiple polling configs sequentially.

Link copied to clipboard
open suspend override fun listActiveIds(): List<String>

IDs of active polling sessions.

Link copied to clipboard
open suspend override fun pause(id: String)

Pause a session by ID.

Link copied to clipboard
open suspend override fun resume(id: String)

Resume a session by ID.

Link copied to clipboard
open suspend override fun <T> run(config: PollingConfig<T>): PollingOutcome<T>

One-shot polling that runs to completion synchronously (suspending).

Link copied to clipboard
open suspend override fun shutdown()

Shutdown the SDK's internal engine. After shutdown, new sessions cannot be started.

Link copied to clipboard
open override fun <T> startPolling(config: PollingConfig<T>): Flow<PollingOutcome<T>>
open override fun <T> startPolling(builder: PollingConfigBuilder<T>.() -> Unit): Flow<PollingOutcome<T>>

Start a new polling session. Returns a lightweight PollingSession handle.

Link copied to clipboard
open suspend override fun updateBackoff(id: String, newPolicy: BackoffPolicy)

Update backoff/options for a running session by ID.