Documentation
¶
Overview ¶
Package aggregate provides engine components that orchestrate the execution of aggregate message handlers.
Index ¶
- type CommandPump
- func (p *CommandPump) AcquireDelivery(ctx context.Context, tx *sql.Tx) (messagepump.Delivery, bool, error)
- func (p *CommandPump) HandleDelivery(ctx context.Context, tx *sql.Tx, delivery messagepump.Delivery, ...) error
- func (p *CommandPump) PostponeDelivery(ctx context.Context, tx *sql.Tx, delivery messagepump.Delivery, ...) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandPump ¶
type CommandPump struct {
DB *sql.DB
Handler dogma.AggregateMessageHandler[dogma.AggregateRoot]
Identity *identitypb.Identity
Packer *envelopepb.Packer
CommandTypeIDs *uuidpb.Set
OutboundMessageTypes map[reflect.Type]struct{}
}
CommandPump is a messagepump.Driver that delivers pending commands to an aggregate message handler of a specific type.
func (*CommandPump) AcquireDelivery ¶
func (p *CommandPump) AcquireDelivery(ctx context.Context, tx *sql.Tx) (messagepump.Delivery, bool, error)
AcquireDelivery attempts to acquire the next pending command for an aggregate handler of one of the configured types.
func (*CommandPump) HandleDelivery ¶
func (p *CommandPump) HandleDelivery( ctx context.Context, tx *sql.Tx, delivery messagepump.Delivery, envelope *envelopepb.Envelope, logger *slog.Logger, ) error
HandleDelivery dispatches a command to the aggregate handler.
func (*CommandPump) PostponeDelivery ¶
func (p *CommandPump) PostponeDelivery( ctx context.Context, tx *sql.Tx, delivery messagepump.Delivery, delay time.Duration, ) error
PostponeDelivery reschedules the command for redelivery after delay.
Click to show internal directories.
Click to hide internal directories.