scheduler

package
v0.0.0-...-91b6c6a Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2024 License: GPL-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IsScheduled

func IsScheduled(key string) bool

func Schedule

func Schedule(key string, task *Task)

func Unschedule

func Unschedule(key string)

Types

type Task

type Task struct {
	LastRunAt             time.Time
	RunAt                 time.Time
	Delay                 time.Duration
	Repeat, RepeatCounter int
	Callback              TaskCallback
}

func NewRepeatingTask

func NewRepeatingTask(delay time.Duration, repeat int, callback TaskCallback) *Task

func NewRunLaterTask

func NewRunLaterTask(delay time.Duration, callback TaskCallback) *Task

type TaskCallback

type TaskCallback func(params ...any)

Jump to

Keyboard shortcuts

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