manager

package
v0.0.22 Latest Latest
Warning

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

Go to latest
Published: Oct 24, 2021 License: AGPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProviderSet = wire.NewSet(NewManager)

Functions

This section is empty.

Types

type Handler

type Handler interface {
	IsMatched(tp string) bool
	Work(process *models.Process) error
}

type ProcessElement

type ProcessElement struct {
	IsLocked bool
	LockedAt time.Time

	BlockId int
	Process *models.Process
	C       chan *models.Slots
}

type ProcessManager

type ProcessManager interface {
	List()
	Push(blockId int, process *models.Process) <-chan *models.Slots
	Fetch(judgementId, processId, processType string, ignoreLock bool) *ProcessElement
	Finish(element *ProcessElement, slots *models.Slots) error
	FinishWithError(element *ProcessElement, message string) error
	Reserve(element *ProcessElement) bool
}

func GetManager

func GetManager() ProcessManager

func NewManager

func NewManager(logger *zap.Logger, ins []Handler) ProcessManager

Jump to

Keyboard shortcuts

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