scheduler

package
v0.0.0-...-8939947 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2022 License: MIT Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Option

type Option func(*Scheduler)

Option is used to inject dependencies into a Scheduler on creation.

func WithRunDelay

func WithRunDelay(d time.Duration) Option

WithRunDelay allows configuring a minimum delay between runs of a package.

func WithRunTimeout

func WithRunTimeout(d time.Duration) Option

WithRunTimeout allows configuring a maximum timeout before runs are deemed stale and reset.

type Scheduler

type Scheduler struct {
	Packages map[string]*tester.Package
	// contains filtered or unexported fields
}

Scheduler schedules runs.

func NewScheduler

func NewScheduler(db db.DB, packages []*tester.Package, opts ...Option) *Scheduler

NewScheduler constructs a new scheduler.

func (*Scheduler) Run

func (s *Scheduler) Run()

Run starts the scheduler.

func (*Scheduler) Schedule

func (s *Scheduler) Schedule(ctx context.Context, packageName string, args ...string) (*tester.Run, error)

func (*Scheduler) Stop

func (s *Scheduler) Stop()

Stop stops the scheduler.

Jump to

Keyboard shortcuts

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