scheduler

package
v0.25.0 Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: AGPL-3.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckCanRun

func CheckCanRun(boxFunc BoxFunc) bool

Types

type BoxFunc

type BoxFunc func(id int, mem int64, logger *slog.Logger) (eval.Sandbox, error)

type BoxManager

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

BoxManager manages a box with eval-based submissions

func New

func New(startingNumber int, count int, maxMemory int64, logger *slog.Logger, boxGenerator BoxFunc) (*BoxManager, error)

New creates a new box manager

func (*BoxManager) Close

func (b *BoxManager) Close(ctx context.Context) error

Close waits for all boxes to finish running

func (*BoxManager) NumConcurrent

func (b *BoxManager) NumConcurrent() int64

func (*BoxManager) RunBox2 added in v0.25.0

func (mgr *BoxManager) RunBox2(ctx context.Context, req *eval.Box2Request, memQuota int64) (*eval.Box2Response, error)

func (*BoxManager) SubRunner

func (b *BoxManager) SubRunner(ctx context.Context, numConc int64) (eval.BoxScheduler, error)

Jump to

Keyboard shortcuts

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