Package-level declarations

Types

Link copied to clipboard

Subscription source scoped to an aggregate stream.

Link copied to clipboard
sealed interface CheckpointingPolicy<out CHECKPOINT : Checkpoint>

Declares whether the subscriber or SubscriptionRunner manages its checkpoint.

Link copied to clipboard
data class EventFilter(val aggregateIds: List<String>? = null, val eventTypes: List<String>? = null)

Optional aggregate and persisted event-type filters for a subscription.

Link copied to clipboard

Application handler for ordered batches delivered by a SubscriptionRunner.

Link copied to clipboard

Convenience subscriber for projections rebuilt by replaying from the beginning.

Link copied to clipboard
data class EventSubscription<EVENT, CHECKPOINT : Checkpoint>(val batches: ReceiveChannel<List<SubscriptionEvent<EVENT, CHECKPOINT>>>, val status: StateFlow<EventSubscriptionStatus>, awaitTermination: suspend () -> Unit = {})
Link copied to clipboard

Source of ordered committed events with at-least-once delivery. Checkpoints identify subscription positions rather than aggregate versions.

Link copied to clipboard
sealed interface EventSubscriptionStatus

Progress state of an event subscription.

Link copied to clipboard

Subscription source spanning configured aggregate streams.

Link copied to clipboard

Use only when the application guarantees that one runner instance exists per subscriber ID.

Link copied to clipboard

Ordered events and the checkpoint immediately preceding them. For automatic checkpointing this is the durable checkpoint. A manual subscriber owns the claim that its preceding checkpoint was durably persisted before its previous callback returned.

Link copied to clipboard
data class SubscriptionEvent<EVENT, CHECKPOINT : Checkpoint>(val checkpoint: CHECKPOINT, val committedEvent: CommittedEvent<EVENT>) : HasAggregateVersion

A committed event and its subscription checkpoint. version remains local to the aggregate.

Link copied to clipboard

Renewable ownership held by a running subscription connection.

Link copied to clipboard
data class SubscriptionOptions(val maxBatchSize: Int = 200, val channelCapacity: Int = 1)

Universal options for event stream subscription batching and backpressure buffering.

Link copied to clipboard
fun interface SubscriptionOwnership

Coordinates exclusive processing for one stable automatic subscriber ID.

Link copied to clipboard

The runner's previously acquired lease is no longer valid.

Link copied to clipboard

Current ownership state of a SubscriptionRunner.

Expected contention: another healthy runner currently owns this subscriber ID.

Link copied to clipboard
class SubscriptionRunner<EVENT, CHECKPOINT : Checkpoint>(source: EventSubscriptionSource<EVENT, CHECKPOINT>, subscriber: EventSubscriber<EVENT, CHECKPOINT>, checkpointStore: CheckpointStore<CHECKPOINT>, ownership: SubscriptionOwnership, initialDelay: Duration = Duration.ZERO, reconnectDelay: Duration = 5.seconds)

Runs an EventSubscriber, managing reconnection, lifecycle, and optional checkpoint persistence.

Link copied to clipboard
sealed interface SubscriptionRunnerState

Lifecycle of a SubscriptionRunner.

Link copied to clipboard
class SubscriptionSourceLifecycle(dispatcher: CoroutineDispatcher, name: String)
Link copied to clipboard
sealed interface SubscriptionStart<out CHECKPOINT : Checkpoint>

Starting position for a subscription.