outbox

package
v0.0.0-...-1b45d90 Latest Latest
Warning

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

Go to latest
Published: Nov 15, 2026 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Overview

Package outbox works the API's River jobs: the jobs another service enqueues in the shared database for work only the API can do, because it holds the orchestrator connections.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	MaxWorkers      int
	BacklogInterval time.Duration
}

type Dependencies

type Dependencies struct {
	Pool        *pgxpool.Pool
	Sandboxes   teamSandboxes
	Containment teamContainer
	TeamCache   teamCache
	Teams       *authdb.Client
	Logger      logger.Logger
	Telemetry   *telemetry.Client
	Config      Config
}

type River

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

func New

func New(deps Dependencies) (*River, error)

func (*River) Client

func (r *River) Client() *river.Client[pgx.Tx]

Client enqueues jobs in a caller's transaction, so they run only if it commits.

func (*River) Start

func (r *River) Start(ctx context.Context) error

func (*River) Stop

func (r *River) Stop(ctx context.Context) error

Stop waits for running jobs until ctx ends. A job still running then is rescued after rescueStuckJobsAfter and retried.

Jump to

Keyboard shortcuts

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