postgres

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: May 17, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultTableName = "agentflow_jobs"

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Queue) error

func WithTableName

func WithTableName(name string) Option

type Queue

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

func NewQueue

func NewQueue(db *sql.DB, opts ...Option) (*Queue, error)

func (*Queue) Cancel

func (q *Queue) Cancel(ctx context.Context, jobID string) error

func (*Queue) Complete

func (q *Queue) Complete(ctx context.Context, lease asyncpkg.Lease) error

func (*Queue) Enqueue

func (q *Queue) Enqueue(ctx context.Context, job asyncpkg.Job) (asyncpkg.Job, error)

func (*Queue) Fail

func (q *Queue) Fail(ctx context.Context, lease asyncpkg.Lease, cause error) error

func (*Queue) Lease

func (q *Queue) Lease(ctx context.Context, workerID string, ttl time.Duration) (asyncpkg.Lease, bool, error)

func (*Queue) Load

func (q *Queue) Load(ctx context.Context, jobID string) (asyncpkg.Job, error)

func (*Queue) Renew

func (q *Queue) Renew(ctx context.Context, lease asyncpkg.Lease, ttl time.Duration) (asyncpkg.Lease, bool, error)

Jump to

Keyboard shortcuts

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