Package-level declarations

Types

Link copied to clipboard
data class AppendedEntry<P>(val entry: JournalEntry<P>, val entryHash: String? = null)

Result of a successful SagaJournal.append call.

Link copied to clipboard
data class ChainHead(val seq: Long, val entryId: String)

Lightweight pointer to the latest entry in a saga run's journal.

Link copied to clipboard

Lifecycle phase of a JournalEntry within a saga run.

Link copied to clipboard
sealed interface Hashing

Hashing strategy for journal entries — controls whether AppendedEntry.entryHash is populated.

Link copied to clipboard

Reference implementation of SagaJournal backed by a ConcurrentHashMap with per-RunId locking.

Link copied to clipboard
data class JournalConfig(val hashing: Hashing = Hashing.None, val intentPhaseEnabled: Boolean = true, val bufferSize: Int = SYNCHRONOUS)

Configuration for a SagaJournal instance.

Link copied to clipboard
data class JournalEntry<P>(val runId: RunId, val seq: Long, val step: TypedValue?, val phase: EntryPhase, val payload: P, val reverses: Long? = null, val createdAtMillis: Long, val metadata: Map<String, String> = emptyMap())

An immutable record of a single event within a saga run.

Link copied to clipboard
sealed interface JournalOutcome<out T>

Library-owned result type for all SagaJournal operations.

Link copied to clipboard
interface PayloadCodec<P>

Serialization seam for saga payloads stored in a SagaJournal.

Link copied to clipboard
value class RunId(val value: String)

Opaque identifier for a single saga run.

Link copied to clipboard
interface SagaJournal<P>

Pluggable append-only event log for saga executions.

Link copied to clipboard
sealed interface VerifyResult

Result of a SagaJournal.verify call.

Functions

Link copied to clipboard
suspend fun <P> SagaJournal<P>.verify(runId: RunId, fromSeq: Long = 0, toSeq: Long = Long.MAX_VALUE, pageSize: Int = DEFAULT_VERIFY_PAGE_SIZE): JournalOutcome<VerifyResult>

Verifies the tamper-evident hash chain for runId over entries with seq in [fromSeq, toSeq].