worker

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Worker

type Worker struct {
	Monitor       *monitor.Worker
	ConnectionIDs map[string]bool
	Store         *store.Store
	Source        provider.Source
	Interval      time.Duration
	Logger        *slog.Logger
	Now           func() time.Time
}

func New

func New(db *store.Store, source provider.Source, interval time.Duration, logger *slog.Logger) *Worker

func (*Worker) Run

func (w *Worker) Run(ctx context.Context)

func (*Worker) Step

func (w *Worker) Step(ctx context.Context) error

Step processes at most one job. A lease fences results from a worker that has lost ownership.

Jump to

Keyboard shortcuts

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