scheduler

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2026 License: MIT 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 {
	// contains filtered or unexported fields
}

Scheduler runs periodic tasks.

func New

func New() *Scheduler

New creates a new Scheduler.

func (*Scheduler) Start

func (s *Scheduler) Start(tasks []Task)

Start begins all scheduled tasks.

func (*Scheduler) Stop

func (s *Scheduler) Stop()

Stop gracefully stops the scheduler.

type Task

type Task struct {
	Name     string
	Schedule string // cron expression
	Fn       func(ctx context.Context) error
}

Task is a periodic task definition.

func DefaultTasks

func DefaultTasks() []Task

DefaultTasks returns the standard set of periodic tasks. Each task's Fn should be set by the caller with access to services.

Jump to

Keyboard shortcuts

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