worker

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CalculateRetryDelay

func CalculateRetryDelay(attempt int, maxRetries int) time.Duration

Types

type Claimer

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

func NewClaimer

func NewClaimer(store storage.Storage, workerID string, batchSize int) *Claimer

func (*Claimer) Start

func (c *Claimer) Start()

func (*Claimer) Stop

func (c *Claimer) Stop()

func (*Claimer) Tasks

func (c *Claimer) Tasks() <-chan *task.Task

type ExponentialBackoff

type ExponentialBackoff struct {
	BaseDelay  time.Duration
	MaxDelay   time.Duration
	Multiplier float64
}

func NewExponentialBackoff

func NewExponentialBackoff(base, max time.Duration) *ExponentialBackoff

func (*ExponentialBackoff) NextDelay

func (e *ExponentialBackoff) NextDelay(attempt int) time.Duration

type FixedBackoff

type FixedBackoff struct {
	Delay time.Duration
}

func NewFixedBackoff

func NewFixedBackoff(delay time.Duration) *FixedBackoff

func (*FixedBackoff) NextDelay

func (f *FixedBackoff) NextDelay(attempt int) time.Duration

type LinearBackoff

type LinearBackoff struct {
	BaseDelay time.Duration
	MaxDelay  time.Duration
}

func NewLinearBackoff

func NewLinearBackoff(base, max time.Duration) *LinearBackoff

func (*LinearBackoff) NextDelay

func (l *LinearBackoff) NextDelay(attempt int) time.Duration

type NoBackoff

type NoBackoff struct{}

func (*NoBackoff) NextDelay

func (n *NoBackoff) NextDelay(attempt int) time.Duration

type Pool

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

func NewPool

func NewPool(store storage.Storage, registry *registry.Registry, count int) *Pool

func (*Pool) Start

func (p *Pool) Start()

func (*Pool) Stop

func (p *Pool) Stop()

type Processor

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

func NewProcessor

func NewProcessor(store storage.Storage, registry *registry.Registry,
	workerID string, taskChan <-chan *task.Task, concurrency int) *Processor

func (*Processor) Start

func (p *Processor) Start()

func (*Processor) Stop

func (p *Processor) Stop()

type RetryStrategy

type RetryStrategy interface {
	NextDelay(attempt int) time.Duration
}

type Worker

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

Jump to

Keyboard shortcuts

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