scheduler

package
v10.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 8, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Scheduler

type Scheduler struct {
	*sch.Scheduler
}

Scheduler represents a generic Scheduler

func GetInstance

func GetInstance() *Scheduler

GetInstance returns the scheduler singleton.

func (*Scheduler) DoAt

func (s *Scheduler) DoAt(task func(), date time.Time) string

DoAt runs a task on a specific date. If the date is in the past, DoAt will run instantly.

func (*Scheduler) DoEvery

func (s *Scheduler) DoEvery(task func(), seconds int) string

DoEvery repeatedly runs a task after a number of seconds.

func (*Scheduler) DoIn

func (s *Scheduler) DoIn(task func(), seconds int) string

DoIn runs a specific task after a number of seconds.

type TaskScheduler

type TaskScheduler interface {
	DoIn(task func(), seconds int) string
	DoEvery(task func(), seconds int) string
	DoAt(task func(), date time.Time) string
}

TaskScheduler defines the basic operations that every Scheduler should fulfill

Jump to

Keyboard shortcuts

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