integration

package
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 4, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Overview

Package integration provides engine components that orchestrate the execution of integration message handlers.

Index

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.IntegrationMessageHandler
	Identity             *identitypb.Identity
	Concurrency          dogma.ConcurrencyPreference
	Packer               *envelopepb.Packer
	CommandTypeIDs       *uuidpb.Set
	OutboundMessageTypes map[reflect.Type]struct{}
}

CommandPump is a messagepump.Driver that delivers pending commands to an integration 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 integration 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 integration 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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL