taskmanager

package
v0.0.0-...-5004fd2 Latest Latest
Warning

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

Go to latest
Published: Jan 19, 2024 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartWithGracefulShutdown

func StartWithGracefulShutdown(c context.Context, tm TaskManager) error

Types

type IntervalExecutor

type IntervalExecutor interface {
	Name() string
	Execute(context.Context) (time.Duration, error)
	Close(context.Context) error
}

type Task

type Task interface {
	Name() string
	Start(c context.Context, sigCh <-chan os.Signal) error
}

func IntervalExecutorTask

func IntervalExecutorTask(executor IntervalExecutor, initialDelay time.Duration) Task

func NewTask

func NewTask(name string, start func(c context.Context, sigCh <-chan os.Signal) error) Task

type TaskManager

type TaskManager interface {
	Start(c context.Context, sigCh <-chan os.Signal) error
	WithTask(Task) TaskManager
}

func NewChainedTaskManager

func NewChainedTaskManager() TaskManager

Jump to

Keyboard shortcuts

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