Help us shape the future of Go! Take the 2026 Go Developer Survey

delivery

package
v1.9.3 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package delivery publishes accepted outbox intents independently of workflow workers.

Index

Constants

This section is empty.

Variables

View Source
var ErrConfirmedConflict = errors.New("dispatch: confirmed sink conflict")

ErrConfirmedConflict is returned only after a sink confirms conflicting durable content for this source identity. Unknown outcomes remain retryable.

View Source
var ErrIncompleteShutdown = errors.New("dispatch: delivery shutdown incomplete")

Functions

This section is empty.

Types

type Config

type Config struct {
	InstallationID string
	Owner          string
	Concurrency    int
	PollInterval   time.Duration
	CallTimeout    time.Duration
	StoreTimeout   time.Duration
	LeaseDuration  time.Duration
	RetryMin       time.Duration
	RetryMax       time.Duration
}

Config bounds work separately for each destination. Concurrency is the maximum number of calls, including calls whose sink ignores context cancellation.

type Option

type Option func(*Publisher)

Option configures a Publisher beyond its Config.

func WithTelemetry

func WithTelemetry(t *telemetry.Telemetry) Option

WithTelemetry sets where the publisher records its spans and metrics: one root "deliver outbox event" span per claimed delivery, and the delivery duration and lag histograms. The Forge extension passes the engine's own.

type Publisher

type Publisher struct {
	// contains filtered or unexported fields
}

func New

func New(store durable.OutboxStore, config Config, sinks map[durable.Destination]Sink, opts ...Option) (*Publisher, error)

func (*Publisher) Start

func (p *Publisher) Start() error

Start owns its lifetime independently of the caller's startup context.

func (*Publisher) Status

func (p *Publisher) Status(ctx context.Context, destination durable.Destination) (Status, error)

func (*Publisher) Stop

func (p *Publisher) Stop(ctx context.Context) error

Stop drains pending work until the caller's deadline. A canceled or hung sink never gets acknowledged and never causes replacement goroutines. Go cannot forcibly terminate sink code; incomplete shutdown is reported explicitly.

type Sink

type Sink interface {
	Accept(context.Context, durable.Delivery) (durable.SinkReceipt, error)
}

Sink accepts an immutable envelope durably. Identical retries, including after an unknown outcome, must return the same receipt. Conflicting content must fail. A transport acknowledgement alone does not satisfy this contract.

type Status

type Status struct {
	Blocked          int64
	Pending          int64
	OldestAcceptedAt time.Time
	InFlight         int
	ErrorCategory    string
}

Directories

Path Synopsis
Package ecosystem maps Dispatch envelopes to reliable ecosystem acceptance APIs.
Package ecosystem maps Dispatch envelopes to reliable ecosystem acceptance APIs.

Jump to

Keyboard shortcuts

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