package eventsourcedentity
- Alphabetic
- Public
- Protected
Type Members
- trait CommandContext extends EventSourcedEntityContext with MetadataContext
An event sourced command context.
- trait EventContext extends EventSourcedEntityContext
- abstract class EventSourcedEntity[S] extends AnyRef
The Event Sourced state model captures changes to data by storing events in a journal.
The Event Sourced state model captures changes to data by storing events in a journal. The current entity state is derived from the emitted events.
When implementing an Event Sourced Entity, you first define what will be its internal state (your domain model), the commands it will handle (mutation requests) and the events it will emit (state changes).
Each command is handled by a command handler. Command handlers are methods returning an kalix.scalasdk.eventsourcedentity.EventSourcedEntity.Effect. When handling a command, you use the Effect API to:
- emit events and build a reply
- directly returning to the caller if the command is not requesting any state change
- rejected the command by returning an error
- instruct Kalix to delete the entity
Each event is handled by an event handler method and should return an updated state for the entity.
- S
The type of the state for this entity.
- trait EventSourcedEntityContext extends EntityContext
Root context for all event sourcing contexts.
- trait EventSourcedEntityOptions extends EntityOptions
Root entity options for all event sourcing entities.
- trait EventSourcedEntityProvider[S, E <: EventSourcedEntity[S]] extends AnyRef
Register an event sourced entity in
kalix.scalasdk.Kalix
using aEventSourcedEntityProvider
.Register an event sourced entity in
kalix.scalasdk.Kalix
using aEventSourcedEntityProvider
. The concreteEventSourcedEntityProvider
is generated for the specific entities defined in Protobuf, for exampleCustomerEntityProvider
.
Value Members
- object EventSourcedEntity
- object EventSourcedEntityOptions