Documentation
¶
Overview ¶
Package exec implements the command execution pipeline for Asynx.
CommandExecutor[T] applies the three-phase command processing pattern:
- Load — Fetch current aggregate state from EventStore; nil if not found
- Validate — Call Command.Validate(state); return raw error if rejected
- Write — Call EventStore.Write; wrap storage errors as ErrPipelineFailed
- Dispatch — Call Dispatcher.Dispatch to deliver the event through the bus
Validation errors short-circuit at phase 2; no event is written. Storage errors at phase 3 wrap to ErrPipelineFailed. Event dispatching uses the Dispatcher's per-aggregate ordered delivery via context.WithoutCancel to survive caller's deadline.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandExecutor ¶
type CommandExecutor[T any] struct { // contains filtered or unexported fields }
func New ¶
func New[T any]( es *eventstore.EventStore[T], d *dispatcher.Dispatcher[T], ) *CommandExecutor[T]
Click to show internal directories.
Click to hide internal directories.