multi

package
v0.2201.10 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2022 License: Apache-2.0 Imports: 12 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

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

Implements host.Runtime.

func (*Aggregate) Call

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

Implements host.Runtime.

func (*Aggregate) GetInfo

Implements host.Runtime.

func (*Aggregate) ID

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

Implements host.Runtime.

func (*Aggregate) SetVersion

func (agg *Aggregate) SetVersion(ctx context.Context, version version.Version) error

SetVersion sets the active runtime version. 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.

func (*Aggregate) Start

func (agg *Aggregate) Start() error

Implements host.Runtime.

func (*Aggregate) Stop

func (agg *Aggregate) Stop()

Implements host.Runtime.

func (*Aggregate) WatchEvents

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

Implements host.Runtime.

Jump to

Keyboard shortcuts

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