EventHandler

class EventHandler(val model: Model, val eventStore: EventStore, val objectStore: BusinessObjectStore)

Constructors

Link copied to clipboard
constructor(model: Model, eventStore: EventStore, objectStore: BusinessObjectStore)

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
suspend fun handleEvent(event: Event): EitherNel<EventHandlingError, List<BusinessObject>>

Attempts to handle the given event by applying it to the BusinessObject to which it is targeted. If the event is successfully applied, the affected BusinessObjects are stored/updated in the BusinessObjectStore and the event is stored in the EventStore. If the event is not successfully applied, the event is not stored and the BusinessObjects are not updated.