AppendOutcome

sealed interface AppendOutcome

How an append ended. Every expected result is a value; only a defect is an exception.

Inheritors

Types

Link copied to clipboard
class AlreadyCommitted @InternalWowApi constructor(val existing: EventStreamRecord) : AppendOutcome

A stream with the same tenant and request id is already committed: existing.

Link copied to clipboard
class Committed @InternalWowApi constructor(val position: LogPosition) : AppendOutcome

The stream is committed at position.

Link copied to clipboard
class Conflict @InternalWowApi constructor(val currentVersion: Int) : AppendOutcome

Another stream already holds the version; the aggregate is at currentVersion.

Link copied to clipboard
class Rejected @InternalWowApi constructor(val cause: Throwable) : AppendOutcome

The backend refuses the stream as it is, for good, and nothing was committed: a value it cannot store (a decimal MongoDB cannot keep exactly, a \u0000 PostgreSQL's jsonb does not take), an identifier too long for its index. Appending it again is refused the same way, so it is neither retried nor read back; cause says why. In a group (EventLog.appendAll) it fails that stream alone.

Link copied to clipboard
class Unknown @InternalWowApi constructor(val cause: Throwable) : AppendOutcome

Whether the append committed is unknown, for example after a timeout. The version slot decides it: read the stream at the appended version before deciding again.