scheduler

package
v0.0.0-...-5206ba3 Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: BSD-3-Clause, BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Modifier

type Modifier func(*Scheduler)

func WithTimeAfter

func WithTimeAfter(ta TimeAfter) Modifier

func WithTimeSource

func WithTimeSource(ts TimeSource) Modifier

func WithTimeWait

func WithTimeWait(td time.Duration) Modifier

func WithWaitGroup

func WithWaitGroup(wg *sync.WaitGroup) Modifier

type Modifiers

type Modifiers []Modifier

type Scheduler

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

func New

func New(mods ...Modifier) *Scheduler

New creates a new scheduler.

func (*Scheduler) AddAfter

func (s *Scheduler) AddAfter(d time.Duration, work Work)

func (*Scheduler) AddAt

func (s *Scheduler) AddAt(t time.Time, work Work)

func (*Scheduler) Cancel

func (s *Scheduler) Cancel()

func (*Scheduler) Done

func (s *Scheduler) Done()

func (*Scheduler) Loop

func (s *Scheduler) Loop()

func (*Scheduler) Wait

func (s *Scheduler) Wait()

type TimeAfter

type TimeAfter func(time.Duration) <-chan time.Time

type TimeSource

type TimeSource func() time.Time

type Work

type Work func()

Jump to

Keyboard shortcuts

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