scheduler

package
v0.26.2 Latest Latest
Warning

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

Go to latest
Published: Oct 11, 2024 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 BatchRunner

type BatchRunner[T any] func(ctx context.Context, keys []string, providers []func() (T, error)) (map[string]T, error)

type Scheduler

type Scheduler[T any] interface {
	ScheduleJob(key string, provider func() (T, error)) (T, error)
	Run(ctx context.Context) error
}

func NewScheduler

func NewScheduler[T any](config cfg.Config, batchRunner BatchRunner[T], name string) Scheduler[T]

func NewSchedulerWithSettings

func NewSchedulerWithSettings[T any](batchRunner BatchRunner[T], metricWriter metric.Writer, name string, settings Settings) Scheduler[T]

type Settings

type Settings struct {
	BatchTimeout time.Duration `cfg:"batch_timeout" default:"10ms"`
	RunnerCount  int           `cfg:"runner_count" default:"25"`
	MaxBatchSize int           `cfg:"max_batch_size" default:"25"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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