task

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 21, 2022 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const GoroutineIndexKey = "goroutine_index"

Variables

This section is empty.

Functions

func StartAsyncTask

func StartAsyncTask(name string, task func())

任务只会执行一次

func StartBackgroundTask

func StartBackgroundTask(name string, period time.Duration, task func())

任务会永远的运行下去

Types

type WorkGroup added in v0.2.4

type WorkGroup interface {
	Start()
	Stop()
}

func NewWorkGroup added in v0.2.4

func NewWorkGroup(
	parentCtx context.Context,
	name string,
	period time.Duration,
	taskFunc func(ctx context.Context),
	parallelNum int) WorkGroup

Jump to

Keyboard shortcuts

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