postgres

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 4, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package postgres is an xoutbox.Store for PostgreSQL 12+ using database/sql (works with pgx/stdlib and lib/pq).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option added in v0.1.0

type Option = sqlstore.Option

Option configures the store.

func WithMaxAttempts added in v0.1.0

func WithMaxAttempts(n int) Option

WithMaxAttempts sets the default attempt limit for new events (default 10).

func WithOrdering added in v0.1.0

func WithOrdering() Option

WithOrdering enables strict per-key ordering: an event is not claimed while an older event with the same Key is pending or in flight (head-of-line blocking).

func WithTable added in v0.1.0

func WithTable(name string) Option

WithTable sets the table name, optionally schema-qualified (default "outbox").

type Store

type Store struct{ *sqlstore.Base }

Store implements xoutbox.Store and xoutbox.Cleaner.

func New

func New(db *sql.DB, opts ...Option) *Store

func (*Store) Claim added in v0.1.0

func (s *Store) Claim(ctx context.Context, owner string, limit int, lease time.Duration) ([]xoutbox.Event, error)

Claim atomically leases due rows in a single round trip using FOR UPDATE SKIP LOCKED.

Jump to

Keyboard shortcuts

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