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 ¶
- Variables
- type Aggregate
- func (agg *Aggregate) Abort(ctx context.Context, force bool) error
- func (agg *Aggregate) AddVersion(version version.Version, rt host.Runtime) error
- func (agg *Aggregate) Call(ctx context.Context, body *protocol.Body) (*protocol.Body, error)
- func (agg *Aggregate) Component(id component.ID) (host.Runtime, bool)
- func (agg *Aggregate) GetActiveVersion() (*version.Version, error)
- func (agg *Aggregate) GetCapabilityTEE() (*node.CapabilityTEE, error)
- func (agg *Aggregate) GetInfo(ctx context.Context) (*protocol.RuntimeInfoResponse, error)
- func (agg *Aggregate) HasVersion(version version.Version) bool
- func (agg *Aggregate) ID() common.Namespace
- func (agg *Aggregate) RemoveVersion(version version.Version) error
- func (agg *Aggregate) SetVersion(active *version.Version, next *version.Version)
- func (agg *Aggregate) Start()
- func (agg *Aggregate) Stop()
- func (agg *Aggregate) UpdateCapabilityTEE()
- func (agg *Aggregate) Version(version version.Version) (host.Runtime, error)
- func (agg *Aggregate) Versions() []version.Version
- func (agg *Aggregate) WatchEvents() (<-chan *host.Event, pubsub.ClosableSubscription)
Constants ¶
This section is empty.
Variables ¶
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 ¶
This section is empty.
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) AddVersion ¶ added in v0.2500.0
AddVersion adds a new runtime version to the aggregate.
If the newly added version matches the active or the next version, this function will start the provided runtime.
The provided runtime must be newly provisioned, meaning Start() has not been called yet.
func (*Aggregate) GetActiveVersion ¶ added in v0.2400.0
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) HasVersion ¶ added in v0.2500.0
HasVersion checks if runtime host exists for the specified version.
func (*Aggregate) RemoveVersion ¶ added in v0.2500.0
RemoveVersion removes the specified version from the aggregate.
A version cannot be removed if it is currently running, meaning it is marked as the active version or the next version.
func (*Aggregate) SetVersion ¶
SetVersion updates the active and next runtime versions.
If the aggregate is not running, this function simply updates the versions. Otherwise, it performs the following steps:
- If the active version differs from the requested active version, it is unconditionally torn down using Stop().
- If the requested active version has already been started as next version, the next version becomes the new active session. Otherwise, the new active version is started if it exists.
- If the next version differs from the requested next version, it is unconditionally torn down using Stop().
- If the next version is already the requested version, no action is taken. Otherwise, the new next version is started if it exists.
func (*Aggregate) UpdateCapabilityTEE ¶ added in v0.2300.0
func (agg *Aggregate) UpdateCapabilityTEE()
UpdateCapabilityTEE implements host.Runtime.
func (*Aggregate) Version ¶ added in v0.2500.0
Version retrieves the runtime host for the specified version.
func (*Aggregate) Versions ¶ added in v0.2500.0
Versions returns a sorted list of all versions in the aggregate.
func (*Aggregate) WatchEvents ¶
func (agg *Aggregate) WatchEvents() (<-chan *host.Event, pubsub.ClosableSubscription)
WatchEvents implements host.Runtime.