scheduling

package
v0.2300.9 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package scheduling provides tools for scheduling tasks.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Scheduler

type Scheduler interface {
	// AddTask adds given task to the scheduler.
	AddTask(name string, fn func(ctx context.Context) error)

	// Start starts executing tasks in the background. If the scheduler is already running, this is
	// a noop operation.
	Start()

	// Stop stops executing tasks. If the scheduler is not running, this is a noop operation.
	Stop()
}

Scheduler is an interface for scheduling tasks.

func NewFixedRateScheduler

func NewFixedRateScheduler(delay time.Duration, interval time.Duration) Scheduler

NewFixedRateScheduler creates a new fixed rate scheduler.

The interval must be greater than zero; if not, the scheduler will panic.

Jump to

Keyboard shortcuts

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