multi

package
v0.2400.0 Latest Latest
Warning

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

Go to latest
Published: May 13, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package multi implements support for a runtime host aggregator that handles multiplexing multiple instances of other runtime hosts, to enable seamless transitions between versions.

Index

Constants

This section is empty.

Variables

View Source
var (
	// ErrNoActiveVersion is the error returned if there is no active version.
	ErrNoActiveVersion = errors.New("runtime/host/multi: no active version")

	// ErrNoSuchVersion is the error returned if the requested version is unknown.
	ErrNoSuchVersion = errors.New("runtime/host/multi: no such version")
)

Functions

func New

func New(
	id common.Namespace,
	rts map[version.Version]host.Runtime,
) (host.Runtime, error)

New returns a new aggregated runtime. The runtimes provided must be freshly provisioned (ie: Start() must not have been called).

Types

type Aggregate

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

Aggregate is an aggregated runtime consisting of multiple instances of the same runtime (by ID), all with different versions.

func (*Aggregate) Abort

func (agg *Aggregate) Abort(ctx context.Context, force bool) error

Abort implements host.Runtime.

func (*Aggregate) Call

func (agg *Aggregate) Call(ctx context.Context, body *protocol.Body) (*protocol.Body, error)

Call implements host.Runtime.

func (*Aggregate) Component added in v0.2400.0

func (agg *Aggregate) Component(id component.ID) (host.Runtime, bool)

Component implements host.CompositeRuntime.

func (*Aggregate) GetActiveVersion added in v0.2400.0

func (agg *Aggregate) GetActiveVersion() (*version.Version, error)

GetActiveVersion implements host.Runtime.

func (*Aggregate) GetCapabilityTEE added in v0.2300.0

func (agg *Aggregate) GetCapabilityTEE() (*node.CapabilityTEE, error)

GetCapabilityTEE implements host.Runtime.

func (*Aggregate) GetInfo

GetInfo implements host.Runtime.

func (*Aggregate) GetVersion added in v0.2300.0

func (agg *Aggregate) GetVersion(version version.Version) (host.Runtime, error)

GetVersion retrieves the runtime host for the specified version.

func (*Aggregate) ID

func (agg *Aggregate) ID() common.Namespace

ID implements host.Runtime.

func (*Aggregate) SetVersion

func (agg *Aggregate) SetVersion(active version.Version, next *version.Version) error

SetVersion sets the active and next runtime versions. This routine will:

  • Do nothing if the active version is already the requested version.
  • Unconditionally tear down the currently active version (via Stop()).
  • Start the newly active version if it exists.
  • Do nothing if the next version is already the requested version.
  • Start the next version if it exists.

func (*Aggregate) Start

func (agg *Aggregate) Start()

Start implements host.Runtime.

func (*Aggregate) Stop

func (agg *Aggregate) Stop()

Stop implements host.Runtime.

func (*Aggregate) UpdateCapabilityTEE added in v0.2300.0

func (agg *Aggregate) UpdateCapabilityTEE()

UpdateCapabilityTEE implements host.Runtime.

func (*Aggregate) WatchEvents

func (agg *Aggregate) WatchEvents() (<-chan *host.Event, pubsub.ClosableSubscription)

WatchEvents implements host.Runtime.

Jump to

Keyboard shortcuts

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