pgworkerpool

package
v0.0.0-...-98622c7 Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type JobHandler

type JobHandler[I pgqueue.JobData] func(ctx context.Context, input I) (err error)

type Options

type Options struct {
	// default: 200
	ConcurrencyMax uint32
	Logger         *slog.Logger
	// The default OnError handler is to log the error
	OnError func(ctx context.Context, job pgqueue.Job, err error)
}

type WorkerPool

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

func NewPool

func NewPool(inputQueue pgqueue.Queue, options *Options) (*WorkerPool, error)

func (*WorkerPool) AddHandler

func (workerPool *WorkerPool) AddHandler[T pgqueue.JobData](handler JobHandler[T])

func (*WorkerPool) Start

func (workerPool *WorkerPool) Start(ctx context.Context)

Jump to

Keyboard shortcuts

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