schedulers

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2021 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ProviderSet = wire.NewSet(New)

Functions

func Evaluate

func Evaluate(element *TaskElement) (bool, error)

func File

func File(element *TaskElement) (bool, error)

func String

func String(element *TaskElement) (bool, error)

Types

type ProcessElement

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

type Runtime

type Runtime struct {
	Problem    *models.Problem
	Submission *models.Submission
	Judgement  *models.Judgement
	// contains filtered or unexported fields
}

type Scheduler

type Scheduler interface {
	List()

	FinishedJudgement() chan *models.Judgement

	NewRuntime(problem *models.Problem, submission *models.Submission, judgement *models.Judgement, process *models.Process) (*Runtime, error)
	PushRuntime(runtime *Runtime) error
	FinishRuntime(runtime *Runtime)

	FetchTask(judgementId, taskId, taskType string, ignoreLock bool) *TaskElement
	FinishTask(element *TaskElement, slots *models.Slots) error
	FinishTaskWithError(element *TaskElement, message string) error
	LockTask(element *TaskElement) bool
	UnlockTask(element *TaskElement) bool
}

func New

func New(logger *zap.Logger) Scheduler

type TaskElement

type TaskElement struct {
	IsLocked bool
	LockedAt time.Time

	BlockId int
	Task    *models.Task
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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