scheduler

package
v1.0.11 Latest Latest
Warning

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

Go to latest
Published: Mar 6, 2023 License: Apache-2.0 Imports: 2 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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