xtask

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

View Source
const (
	TimeOut_Max   = time.Duration(100*365*24) * time.Hour
	TimeOut_Year  = time.Duration(365*24) * time.Hour
	TimeOut_Month = time.Duration(30*24) * time.Hour
	TimeOut_Day   = time.Duration(24) * time.Hour
	TimeOut_Hour  = time.Hour
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FinishType

type FinishType uint
const (
	//任务执行超时
	FinishType_TimeOut FinishType = iota
	//任务执行中断
	FinishType_Interruput
	//任务结束
	FinishType_Finish
)

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() FinishType

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

func (*Runner) StartAsync

func (r *Runner) StartAsync(callback func(finishType FinishType))

异步执行

type TimeOut

type TimeOut time.Duration

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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