AggregateService

Application-facing entry point for aggregate command handling, lookup, and append recovery.

Inheritors

Functions

Link copied to clipboard
abstract suspend fun getById(id: String): AggregateLookupResult<STATE>
Link copied to clipboard
abstract suspend fun handle(command: CommandEnvelope<COMMAND>): AggregateChangeResult<STATE, EVENT>
Link copied to clipboard
abstract suspend fun recoverAppend(preparedAppend: PreparedAppend<EVENT>): AggregateRecoveryResult<STATE, COMMAND, EVENT>

Recovers an append returned by AggregateChangeResult.Failure.OutcomeUnknown without handling the original command again. The exact preparedAppend is resubmitted so the store can recognize an existing commit or safely commit the same prepared events, after which aggregate state is reloaded from committed history.