PollingApi

interface PollingApi

Public abstraction layer for consumers. Exposes a small, stable API surface. Internals are delegated to the PollingEngine implementation.

Inheritors

Functions

Link copied to clipboard
abstract fun activePollsCount(): Int

Number of active polling sessions.

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

Cancel a session using the session handle.

abstract suspend fun cancel(id: String)

Cancel a session by ID.

Link copied to clipboard
abstract suspend fun cancelAll()

Cancel all active sessions.

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

Compose multiple polling configs sequentially.

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

IDs of active polling sessions.

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

Pause a session by ID.

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

Resume a session by ID.

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

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

Link copied to clipboard
abstract suspend fun shutdown()

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

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

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

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

Update backoff/options for a running session by ID.