task

package
v0.2.17 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2023 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RepeatedTask

type RepeatedTask wrapper

RepeatedTask 自动重复任务 设定间隔时间与任务Handler即可自动按间隔执行,在你不再持有该实例的引用后,任务自动停止。 也可以调用 Stop 方法来停止任务

func NewRepeatedTask

func NewRepeatedTask(interval time.Duration, handler func(time.Time)) *RepeatedTask

NewRepeatedTask 初始化一个自动重复任务 创建成功后请调用 Start 方法启动任务,启动后需等待 interval 时间发生第一次调用

type State

type State int

State RepeatedTask 状态类型

const (
	Init State = iota
	Running
	Stopped
)

State 可能枚举

Jump to

Keyboard shortcuts

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