schedulers

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2019 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 {
	// 生成下一次的时间。相对于 last 时间。
	//
	// 如果返回的时间值,已经小于当前时间,那么该任务会被安排在最先执行。
	// 如果返回是零值,表示该调度已经终结,后续都将返回零。
	//
	// 实现者应该继承 last 的时区信息,即返回值的时区应该和 last 相同,
	// 否则其结果是未定义的。
	//
	// 传递相同的 last 参数,其返回值应该也是相同,或是返回一个零值。
	Next(last time.Time) time.Time

	// Title 返回用于描述当前算法的一个简短介绍。
	Title() string
}

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

Directories

Path Synopsis
Package at 提供类似于 at 指令的定时器
Package at 提供类似于 at 指令的定时器
Package cron 实现了 cron 表达式的 Scheduler 接口
Package cron 实现了 cron 表达式的 Scheduler 接口
Package ticker 时间段固定的定时器,功能与 time.Ticker 相同。
Package ticker 时间段固定的定时器,功能与 time.Ticker 相同。

Jump to

Keyboard shortcuts

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