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

delivery

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package delivery owns receipt renewal, settlement admission, and immutable message snapshots. Native requests and failure wire encoding stay in awsqueue.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type State

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

State owns one receipt's message and serialization slot. Publish completes the message before exposing it to a handler; renewal never reads the message.

func New

func New(message queue.Message, repeated error) *State

New captures an envelope and allocates a receipt-local serialization slot.

func (*State) KeepAlive

func (state *State) KeepAlive(
	ctx context.Context,
	visibility, maximum time.Duration,
	extend func(context.Context) error,
	failed func(context.Context, error),
) func()

KeepAlive owns renewal through handler drain. Its idempotent stop cancels pending I/O before joining the worker. The native callback must honor context cancellation; no native operation is abandoned on a detached goroutine.

func (*State) Message

func (state *State) Message() queue.Message

Message returns detached payload and metadata snapshots for concurrent reads.

func (*State) Publish

func (state *State) Publish(message queue.Message)

Publish captures the decoded envelope before its first handler invocation. The caller must not replace a message after publishing the delivery to a handler. Nil containers remain nil; arbitrary metadata values are strings.

func (*State) Settle

func (state *State) Settle(ctx context.Context, operation func() error) error

Settle admits one operation after pending renewal, preserving the caller's wait budget. Failure resumes renewal and allows another settlement; success permanently excludes renewal and repeated settlement.

Jump to

Keyboard shortcuts

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