switcher

package
v0.0.0-...-9e054ec Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 20 Imported by: 0

Documentation

Overview

Package switcher contains a meta-Sequencer that switches between various modes of operation.

Index

Constants

This section is empty.

Variables

Set is used by Wire.

Functions

This section is empty.

Types

type Mode

type Mode int

Mode describes a strategy using another sequencer.

const (
	ModeUnknown Mode = iota
	ModeBestEffort
	ModeConsistent
	ModeImmediate

	MaxMode = iota - 1 // Used for testing all modes.
	MinMode = Mode(1)  // Used for testing all modes.
)

The modes of operation that can be dynamically selected from.

func (Mode) String

func (i Mode) String() string

type Switcher

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

Switcher switches between delegate sequencers. It also adds script bindings into the sequencer stack.

func ProvideSequencer

func ProvideSequencer(
	best *besteffort.BestEffort,
	core *core.Core,
	diags *diag.Diagnostics,
	imm *immediate.Immediate,
	script *script.Sequencer,
	stagingPool *types.StagingPool,
	targetPool *types.TargetPool,
) *Switcher

ProvideSequencer is called by Wire.

func (*Switcher) Start

Start a sequencer that can switch between various modes of operation. Callers must call Switcher.WithMode before calling this method.

func (*Switcher) WithMode

func (s *Switcher) WithMode(mode *notify.Var[Mode]) *Switcher

WithMode returns a copy of the Switcher that uses the given variable for mode control. This method exists so that Switcher can satisfy the sequencer.Sequencer interface.

Jump to

Keyboard shortcuts

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