Package-level declarations

Types

Link copied to clipboard

Strategy for falling back between different transport mechanisms.

Link copied to clipboard
interface SseSession

Abstraction for a Server-Sent Events (SSE) session.

Link copied to clipboard
fun interface SseSessionFactory<Ctx>

Factory for creating SseSessions.

Link copied to clipboard
data class TaskBridgeCheckpointBinding<Ctx>(val store: TaskBridgeCheckpointStore, val namespace: String? = null, val keyFactory: (Ctx, taskId: String) -> String? = null)

Checkpoint storage and keying for stream resume.

Link copied to clipboard

Abstraction for HTTP operations required by the SDK.

Link copied to clipboard
fun interface TaskBridgeInterceptor<Ctx>

An interceptor that can observe or modify the transport components created by a TaskBridgeTransportFactory.

Link copied to clipboard

Functional interface for long-polling event requests.

Link copied to clipboard

Listener for SSE lifecycle and event data.

Link copied to clipboard
class TaskBridgeStreamTransport<Ctx>(baseUrl: String, context: Ctx, deps: TaskBridgeStreamTransportDeps<Ctx>, checkpoint: TaskBridgeCheckpointBinding<Ctx>, options: TaskBridgeStreamTransportOptions<Ctx> = TaskBridgeStreamTransportOptions())

Transport orchestrator for one observed task stream.

Link copied to clipboard
data class TaskBridgeStreamTransportConfig(val fallbackStrategy: FallbackStrategy = FallbackStrategy.PROGRESSIVE_STICKY, val wsMaxAttempts: Int = 3, val sseMaxAttempts: Int = 3, val pollWaitTimeoutMs: Int = DEFAULT_POLL_WAIT_TIMEOUT_MS, val pollMaxEvents: Int = DEFAULT_POLL_MAX_EVENTS, val pollEmptyBackoffMs: Long = DEFAULT_POLL_EMPTY_BACKOFF_MS, val transportOpenTimeoutMs: Long = DEFAULT_TRANSPORT_OPEN_TIMEOUT_MS, val livenessTimeoutMs: Long = DEFAULT_LIVENESS_TIMEOUT_MS, val wsIncomingChannelCapacity: Int = DEFAULT_WS_INCOMING_CHANNEL_CAPACITY, val sseIncomingChannelCapacity: Int = DEFAULT_SSE_INCOMING_CHANNEL_CAPACITY, val maxMalformedPayloadsBeforeFailure: Int = DEFAULT_MAX_MALFORMED_PAYLOADS)

Configuration options for the event streaming transport.

Link copied to clipboard
data class TaskBridgeStreamTransportDeps<Ctx>(val pollEventsClient: TaskBridgePollEventsClient<Ctx>, val webSocketFactory: WebSocketSessionFactory<Ctx>, val sseSessionFactory: SseSessionFactory<Ctx>, val routeResolver: TaskBridgeRouteResolver<Ctx>, val failureClassifier: TaskBridgeFailureClassifier, val retryPolicy: TaskBridgeRetryPolicy, val retryGate: TransportRetryGate = NoOpTransportRetryGate)

Network and resilience dependencies for TaskBridgeStreamTransport.

Link copied to clipboard
data class TaskBridgeStreamTransportOptions<Ctx>(val streamConfig: TaskBridgeStreamTransportConfig = TaskBridgeStreamTransportConfig(), val eventListener: TaskBridgeTransportEventListener<Ctx>? = null, val json: Json = taskBridgeJson(), val dispatcher: CoroutineDispatcher = Dispatchers.IO)

Encapsulates runtime options for TaskBridgeStreamTransport.

Link copied to clipboard
data class TaskBridgeTransportBundle<Ctx>(val http: TaskBridgeHttpApi<Ctx>, val webSocketFactory: WebSocketSessionFactory<Ctx>, val sseSessionFactory: SseSessionFactory<Ctx>)

A bundle of transport components returned by TaskBridgeTransportFactory.

Link copied to clipboard

Listener for internal transport lifecycle events and diagnostics.

Link copied to clipboard

Factory for creating transport components.

Link copied to clipboard
data class TaskBridgeTransportFactoryConfig<Ctx>(val baseUrl: String, val authHeaderProvider: suspend (context: Ctx, forceRefresh: Boolean) -> String?? = null, val streamTransport: TaskBridgeStreamTransportConfig = TaskBridgeStreamTransportConfig(), val json: Json = taskBridgeJson())

Configuration passed to TaskBridgeTransportFactory.

Link copied to clipboard
value class TaskBridgeTransportSource(val value: Int)

Identifies the transport mechanism that delivered a task event.

Link copied to clipboard

Listener for WebSocket lifecycle and message events.

Link copied to clipboard

Exception thrown when the WebSocket is closed by the server due to a policy violation or authentication error.

Link copied to clipboard

Abstraction for a WebSocket session.

Link copied to clipboard

Factory for creating TaskBridgeWebSocketSessions.

Functions

Link copied to clipboard
fun <Ctx> failingSseSessionFactory(message: String = "SSE disabled by interceptor"): SseSessionFactory<Ctx>

Utility for testing or simulating SSE failures.

Link copied to clipboard
fun <Ctx> failingWebSocketFactory(message: String = "WebSocket disabled by interceptor"): WebSocketSessionFactory<Ctx>

Utility for testing or simulating WebSocket failures.

Link copied to clipboard
fun httpBaseToHttpUrl(httpBase: String, path: String): String

Builds an absolute HTTP(S) URL by combining httpBase with relative path.

Link copied to clipboard

Builds a WebSocket URL by combining httpBase with path.

Link copied to clipboard
fun taskBridgeJson(): Json

Returns a Json instance configured with TaskBridge defaults.

Link copied to clipboard

Wraps this factory with an interceptor.