scheduler

package
v5.0.0-preview.1+incom... Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2022 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action int
const (
	TaskActionDone Action = iota
	TaskActionWait
	TaskActionRetry
	TaskActionRequeue
	TaskActionRequeueWait
)

type Priority

type Priority int
const PriorityHigh Priority = 0
const PriorityLow Priority = 1

type Processor

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

type Schd

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

func (*Schd) AddProcessor

func (s *Schd) AddProcessor(name string) error

func (*Schd) AddTask

func (s *Schd) AddTask(task Task, toHead bool)

func (*Schd) ClearTaskQueue

func (s *Schd) ClearTaskQueue(priority Priority)

func (*Schd) DelProcessor

func (s *Schd) DelProcessor(name string) (string, error)

func (*Schd) DeleteTask

func (s *Schd) DeleteTask(key string, priority Priority) bool

func (*Schd) Init

func (s *Schd) Init()

func (*Schd) Reset

func (s *Schd) Reset()

func (*Schd) TaskCount

func (s *Schd) TaskCount() int

func (*Schd) TaskDone

func (s *Schd) TaskDone(task Task, action Action)

type Task

type Task interface {
	Key() string
	Priority() Priority
	Handler(proc string) Action
	StartTimer()
	CancelTimer()
	Print(msg string)
}

Jump to

Keyboard shortcuts

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