executor

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Executor

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

Executor automatically starts or stops workspaces.

func New

func New(ctx context.Context, db database.Store, log slog.Logger, tick <-chan time.Time) *Executor

New returns a new autobuild executor.

func (*Executor) Run

func (e *Executor) Run()

Run will cause executor to start or stop workspaces on every tick from its channel. It will stop when its context is Done, or when its channel is closed.

func (*Executor) WithStatsChannel added in v0.6.1

func (e *Executor) WithStatsChannel(ch chan<- Stats) *Executor

WithStatsChannel will cause Executor to push a RunStats to ch after every tick.

type Stats added in v0.6.1

type Stats struct {
	Transitions map[uuid.UUID]database.WorkspaceTransition
	Elapsed     time.Duration
	Error       error
}

Stats contains information about one run of Executor.

Jump to

Keyboard shortcuts

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