worker

package
v1.42.0 Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2025 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Job

type Job interface {
	Do(ctx context.Context)
}

type Option

type Option func(w *Worker)

func WithConcurrency

func WithConcurrency(concurrency int) Option

func WithInterval

func WithInterval(interval time.Duration) Option

type Worker

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

func New

func New(job Job, opts ...Option) *Worker

func (*Worker) Run

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

func (*Worker) Shutdown

func (w *Worker) Shutdown()

Jump to

Keyboard shortcuts

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