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

ingestionqueue

package
v0.2.5 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 ingestionqueue owns durable admission and worker contracts.

Index

Constants

This section is empty.

Variables

View Source
var ErrEmpty = errors.New("no ingestion jobs available")
View Source
var ErrFull = errors.New("ingestion queue full; retry later")
View Source
var ErrLeaseLost = errors.New("ingestion lease lost")

Functions

func Run

func Run(ctx context.Context, queue Queue, ingest Ingest, options ...Option) error

Run uses bounded processing and renews leases without coupling ingestion to the queue implementation. A crash after commit is recovered by ingestion replay. Queue storage failures are logged and retried after a backoff instead of stopping the server; an unacknowledged lease expires and is claimed again.

Types

type Delivery

type Delivery struct {
	Job
	OwnerID string
	Token   string
	Request ingestion.Request
}

type Ingest

type Job

type Job = ingestion.Job

type Option added in v0.2.2

type Option func(*worker)

Option adjusts a worker.

func Wake added in v0.2.2

func Wake(signal <-chan struct{}) Option

Wake lets an idle worker claim as soon as signal delivers, such as when another process admits a job. Polling remains the fallback.

type Queue

Queue guarantees durable, idempotent acceptance and fenced job transitions. Completed jobs retain their identity even when the observation is deleted. An external broker adapter must atomically persist scheduling intent (outbox).

Jump to

Keyboard shortcuts

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