queue

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package queue wires the River background job queue over PostgreSQL.

River runs in-process workers against the same database, using SELECT ... FOR UPDATE SKIP LOCKED. Job kinds (media processing, cleanup, delivery retry) are registered here as later milestones add them.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Migrate

func Migrate(ctx context.Context, pool *pgxpool.Pool) error

Migrate applies River's own schema migrations to the database.

Types

type Queue

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

Queue is the background job queue.

func New

func New(pool *pgxpool.Pool, workers *river.Workers) (*Queue, error)

New creates a Queue over the given pool. Callers register their job workers on workers before calling New; an internal no-op worker is always registered so the client can start with an empty registry.

func (*Queue) Start

func (q *Queue) Start(ctx context.Context) error

Start begins processing jobs.

func (*Queue) Stop

func (q *Queue) Stop(ctx context.Context) error

Stop gracefully stops processing.

Jump to

Keyboard shortcuts

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