Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventHandler ¶
type EventHandler struct {
// contains filtered or unexported fields
}
EventHandler is a CQRS saga handler to run a Saga implementation.
func NewEventHandler ¶
func NewEventHandler(saga Saga, commandHandler eh.CommandHandler) *EventHandler
NewEventHandler creates a new EventHandler.
func (*EventHandler) HandleEvent ¶
HandleEvent implements the HandleEvent method of the eventhorizon.EventHandler interface.
func (*EventHandler) HandlerType ¶ added in v0.5.1
func (h *EventHandler) HandlerType() eh.EventHandlerType
HandlerType implements the HandlerType method of the eventhorizon.EventHandler interface.
type Saga ¶
type Saga interface { // SagaType returns the type of the saga. SagaType() Type // RunSaga handles an event in the saga that can return commands. RunSaga(context.Context, eh.Event) []eh.Command }
Saga is an interface for a CQRS saga that listens to events and generate commands. It is used for any long lived transaction and can be used to react on multiple events.
Click to show internal directories.
Click to hide internal directories.