scheduler

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: May 22, 2026 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultConcurrencyMultiplier = 2
)

TODO remove

Variables

This section is empty.

Functions

This section is empty.

Types

type Scheduler

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

Scheduler handles scheduled jobs

func NewScheduler

func NewScheduler(configProvider *config.Provider, db db.DbQueue, executor executor.JobExecutor, logger *slog.Logger) *Scheduler

func (*Scheduler) Executor

func (s *Scheduler) Executor() executor.JobExecutor

Executor returns the job executor used by the scheduler. This allows external components (like the server) to register handlers directly.

func (*Scheduler) Name

func (s *Scheduler) Name() string

Name returns the name of the daemon for logging/identification.

func (*Scheduler) Start

func (s *Scheduler) Start() error

Start begins the job scheduler operation by creating a long running goroutine that will create goroutines to handle backend jobs. It returns nil immediately as the main work happens in the background goroutine.

func (*Scheduler) Stop

func (s *Scheduler) Stop(ctx context.Context) error

Stop signals the scheduler to stop and waits for all jobs to complete or the context to be canceled, whichever comes first

Jump to

Keyboard shortcuts

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