task

package
v1.135.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: MIT Imports: 9 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const DXTaskDefaultAfterDelaySec = 1

Variables

This section is empty.

Functions

This section is empty.

Types

type DXTask

type DXTask struct {
	NameId          string
	StartAt         string
	AfterDelaySec   int64
	OnExecute       DXTaskOnExecute
	Log             log.DXLog
	RuntimeIsActive bool
	Context         context.Context
	Cancel          context.CancelFunc
}

func (*DXTask) ApplyConfigurations

func (a *DXTask) ApplyConfigurations() (err error)

func (*DXTask) StartAndWait

func (a *DXTask) StartAndWait(errorGroup *errgroup.Group) error

func (*DXTask) StartShutdown

func (a *DXTask) StartShutdown() (err error)

type DXTaskManager

type DXTaskManager struct {
	Context           context.Context
	Cancel            context.CancelFunc
	Tasks             map[string]*DXTask
	ErrorGroup        *errgroup.Group
	ErrorGroupContext context.Context
}
var Manager DXTaskManager

func (*DXTaskManager) NewTask

func (am *DXTaskManager) NewTask(nameId string, startAt string, afterDelaySec int64, onExecute DXTaskOnExecute) (*DXTask, error)

func (*DXTaskManager) StartAll

func (am *DXTaskManager) StartAll(errorGroup *errgroup.Group, errorGroupContext context.Context) error

func (*DXTaskManager) StopAll

func (am *DXTaskManager) StopAll() (err error)

type DXTaskOnExecute

type DXTaskOnExecute func(task *DXTask) error

Jump to

Keyboard shortcuts

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