timer_task

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Jun 1, 2022 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 TimerRunner

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

func New

func New(tm time.Duration) *TimerRunner

func (*TimerRunner) Add

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

func (*TimerRunner) Start

func (r *TimerRunner) Start() error

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

func (*TimerRunner) StartAsync

func (r *TimerRunner) StartAsync(callback func(err error))

异步执行

Jump to

Keyboard shortcuts

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