task

package
v1.3.9 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2022 License: GPL-3.0 Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewTickerTask

func NewTickerTask(task Task) <-chan struct{}

NewTickerTask 新建一个被管理的定时任务,并返回可以监听的管理者的心跳

Types

type DoFunc

type DoFunc func(parentCtx context.Context)

type Task

type Task struct {
	Name            string          // task 名
	Ctx             context.Context // 上游ctx
	TaskDuration    time.Duration   // 任务执行周期
	TimeoutDuration time.Duration   // 超时时长
	F               DoFunc          // 执行程序
}

Jump to

Keyboard shortcuts

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