worker

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 18, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Backoff

func Backoff(base, maximum time.Duration, id string, attempt int) time.Duration

Types

type Config

type Config struct {
	Concurrency   int
	PollInterval  time.Duration
	LeaseDuration time.Duration
	BaseBackoff   time.Duration
	MaxBackoff    time.Duration
	PerTarget     int
}

type Metrics

type Metrics struct {
	Attempts         uint64
	Succeeded        uint64
	RetryableFailure uint64
	TerminalFailure  uint64
}

type Pool

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

func New

func New(store *store.Store, client *http.Client, logger *slog.Logger, config Config) *Pool

func (*Pool) Metrics

func (p *Pool) Metrics() Metrics

func (*Pool) Start

func (p *Pool) Start(ctx context.Context)

func (*Pool) Wait

func (p *Pool) Wait()

Jump to

Keyboard shortcuts

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