task

package
v2.0.0+incompatible Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrInterruput = errors.New("run interruput")

任务执行中断

View Source
var ErrTimeOut = errors.New("run time out")

任务执行超时

Functions

This section is empty.

Types

type Runner

type Runner struct {
	// contains filtered or unexported fields
}

后台执行任何限时任务,而且我们还可以控制这个执行者,比如强制终止它等

func New

func New(tm time.Duration) *Runner

工厂方法

func (*Runner) Add

func (r *Runner) Add(tasks ...func())

func (*Runner) Start

func (r *Runner) Start() error

开始执行所有任务,并且监视通道事件

Jump to

Keyboard shortcuts

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