task

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2025 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrTaskAlreadyExists = errors.New("task already exists")
	ErrTaskNotFound      = errors.New("task not found")
)

Functions

This section is empty.

Types

type Group

type Group struct {
	// contains filtered or unexported fields
}

func NewGroup

func NewGroup(tasks ...Task) *Group

func (*Group) Identifier

func (g *Group) Identifier() string

func (*Group) IsStarted

func (g *Group) IsStarted() bool

func (*Group) IsStopped

func (g *Group) IsStopped() bool

func (*Group) Start

func (g *Group) Start(ctx context.Context) error

func (*Group) Stop

func (g *Group) Stop(ctx context.Context) error

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager() *Manager

func (*Manager) GetRunningTasks

func (m *Manager) GetRunningTasks() []string

func (*Manager) GetTaskCount

func (m *Manager) GetTaskCount() int

func (*Manager) IsRunning

func (m *Manager) IsRunning(name string) bool

func (*Manager) StartTask

func (m *Manager) StartTask(ctx context.Context, name string, task Task) error

func (*Manager) StopAll

func (m *Manager) StopAll(ctx context.Context) error

func (*Manager) StopTask

func (m *Manager) StopTask(ctx context.Context, name string) error

func (*Manager) Wait

func (m *Manager) Wait() error

type Task

type Task interface {
	Identifier() string
	Start(ctx context.Context) error
	Stop(ctx context.Context) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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