scheduler

package
v1.7.4 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrBusy = errors.New("busy scheduling previous update")

Functions

This section is empty.

Types

type CoordinatorMetricer added in v1.4.3

type CoordinatorMetricer interface {
	RecordActedL1Block(n uint64)
	RecordGamesStatus(inProgress, defenderWon, challengerWon int)
	RecordGameUpdateScheduled()
	RecordGameUpdateCompleted()
}

type DiskManager

type DiskManager interface {
	DirForGame(addr common.Address) string
	RemoveAllExcept(addrs []common.Address) error
}

type GamePlayer

type GamePlayer interface {
	ValidatePrestate(ctx context.Context) error
	ProgressGame(ctx context.Context) types.GameStatus
	Status() types.GameStatus
}

type PlayerCreator

type PlayerCreator func(game types.GameMetadata, dir string) (GamePlayer, error)

type Scheduler

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

func NewScheduler

func NewScheduler(logger log.Logger, m SchedulerMetricer, disk DiskManager, maxConcurrency uint, createPlayer PlayerCreator, allowInvalidPrestate bool) *Scheduler

func (*Scheduler) Close

func (s *Scheduler) Close() error

func (*Scheduler) Schedule

func (s *Scheduler) Schedule(games []types.GameMetadata, blockNumber uint64) error

func (*Scheduler) Start

func (s *Scheduler) Start(ctx context.Context)

func (*Scheduler) ThreadActive

func (s *Scheduler) ThreadActive()

func (*Scheduler) ThreadIdle

func (s *Scheduler) ThreadIdle()

type SchedulerMetricer

type SchedulerMetricer interface {
	RecordActedL1Block(n uint64)
	RecordGamesStatus(inProgress, defenderWon, challengerWon int)
	RecordGameUpdateScheduled()
	RecordGameUpdateCompleted()
	IncActiveExecutors()
	DecActiveExecutors()
	IncIdleExecutors()
	DecIdleExecutors()
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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