schedulers

package
v0.20.0 Latest Latest
Warning

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

Go to latest
Published: May 5, 2024 License: MIT Imports: 1 Imported by: 2

Documentation

Overview

Package schedulers 实现了部分时间调度的算法

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Scheduler

type Scheduler interface {
	// Next 生成相对于 last 的下一次时间。
	//
	// 如果返回的时间值,已经小于当前时间,那么该任务会被安排在最先执行。
	// 如果返回是零值,表示该调度已经终结,不会再执行该任务,后续也都应返回零值。
	//
	// 传递相同的 last 参数,其返回值应该也相同,或是返回一个零值。
	Next(last time.Time) time.Time
}

Scheduler 时间调度算法需要实现的接口

type SchedulerFunc added in v0.14.0

type SchedulerFunc func(time.Time) time.Time

func (SchedulerFunc) Next added in v0.14.0

func (f SchedulerFunc) Next(last time.Time) time.Time

Directories

Path Synopsis
Package at 提供类似于 at 指令的定时器
Package at 提供类似于 at 指令的定时器
Package cron 实现了 cron 表达式的 [schedulers.Scheduler] 接口 [cron]: https://zh.wikipedia.org/wiki/Cron
Package cron 实现了 cron 表达式的 [schedulers.Scheduler] 接口 [cron]: https://zh.wikipedia.org/wiki/Cron
Package ticker 时间段固定的定时器
Package ticker 时间段固定的定时器

Jump to

Keyboard shortcuts

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