scheduler

package
v0.1.15 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2026 License: MIT Imports: 3 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 executes registered tasks at their intervals.

func New

func New() *Scheduler

New constructs a scheduler instance.

func (*Scheduler) AddTask

func (s *Scheduler) AddTask(task Task)

AddTask registers a task for execution.

func (*Scheduler) Start

func (s *Scheduler) Start(ctx context.Context) error

Start begins executing tasks.

func (*Scheduler) Stop

func (s *Scheduler) Stop(ctx context.Context) error

Stop halts task execution.

type Task

type Task interface {
	Name() string
	Interval() time.Duration
	Run(ctx context.Context) error
}

Task defines a background job.

Jump to

Keyboard shortcuts

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