task

package
v0.0.0-...-baf8ae7 Latest Latest
Warning

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

Go to latest
Published: Dec 17, 2024 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Stopped state = iota
	Paused
	Running
)

Variables

This section is empty.

Functions

This section is empty.

Types

type ControlledTask

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

func GoControlled

func GoControlled(fn controlledTaskFn) *ControlledTask

func (*ControlledTask) OnStateChange

func (t *ControlledTask) OnStateChange(listener stateListener)

func (*ControlledTask) Pause

func (t *ControlledTask) Pause() bool

func (*ControlledTask) Resume

func (t *ControlledTask) Resume() bool

func (*ControlledTask) Run

func (t *ControlledTask) Run()

func (*ControlledTask) Stop

func (t *ControlledTask) Stop() bool

type ControlledTaskManager

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

func NewControlledTaskManager

func NewControlledTaskManager() *ControlledTaskManager

func (*ControlledTaskManager) ActiveCount

func (m *ControlledTaskManager) ActiveCount() int

func (*ControlledTaskManager) Add

func (m *ControlledTaskManager) Add(key string, task *ControlledTask)

func (*ControlledTaskManager) Get

func (*ControlledTaskManager) Has

func (m *ControlledTaskManager) Has(key string) bool

func (*ControlledTaskManager) Pause

func (m *ControlledTaskManager) Pause(key string) bool

func (*ControlledTaskManager) Remove

func (m *ControlledTaskManager) Remove(key string)

func (*ControlledTaskManager) Resume

func (m *ControlledTaskManager) Resume(key string) bool

type Group

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

type LocalizedManager

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

func (*LocalizedManager) Go

func (m *LocalizedManager) Go(fn taskFn, rate time.Duration)

type Manager

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

func NewManager

func NewManager(ctx context.Context, leaderElectionSvc leaderelection.Service) *Manager

func (*Manager) Go

func (m *Manager) Go(key string, rate time.Duration, fn taskFn)

func (*Manager) WithKey

func (m *Manager) WithKey(key string) *LocalizedManager

type Task

type Task struct {
	Func taskFn
	Rate time.Duration
	// contains filtered or unexported fields
}

func New

func New(fn taskFn, rate time.Duration) *Task

func (*Task) Run

func (t *Task) Run(ctx context.Context)

func (*Task) Stop

func (t *Task) Stop()

Jump to

Keyboard shortcuts

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