taskrunner

package module
v0.0.0-...-3d75027 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2022 License: MIT Imports: 4 Imported by: 0

README

taskrunner

This Project if under development and is meant to provide control over goroutines in order to stop or provide meta at runtime

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrorKeyAlreadyExistInMeta = errors.New("key already exist in meta")
	ErrorKeyDidNotExistInMeta  = errors.New("key is not present in meta")
)

Functions

This section is empty.

Types

type Task

type Task struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func (*Task) AddMeta

func (m *Task) AddMeta(key string, val interface{}) error

func (*Task) Cancel

func (m *Task) Cancel()

func (*Task) RemoveMeta

func (m *Task) RemoveMeta(key string) error

type TaskManager

type TaskManager struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

func NewTaskManager

func NewTaskManager() *TaskManager

func (*TaskManager) CancelTaskFromMetaKey

func (tm *TaskManager) CancelTaskFromMetaKey(key string)

func (*TaskManager) FindFromMeta

func (tm *TaskManager) FindFromMeta(key string) *Task

func (*TaskManager) GO

func (tm *TaskManager) GO(ctx context.Context, fn runnable) string

func (*TaskManager) IsOpen

func (tm *TaskManager) IsOpen() bool

func (*TaskManager) RestartTaskFromMetaKey

func (tm *TaskManager) RestartTaskFromMetaKey(key string)

Jump to

Keyboard shortcuts

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