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
- func New(ctx context.Context, id common.Namespace, rts map[version.Version]host.Runtime) (host.Runtime, error)
- type Aggregate
- func (agg *Aggregate) Abort(ctx context.Context, force bool) error
- func (agg *Aggregate) Call(ctx context.Context, body *protocol.Body) (rsp *protocol.Body, err error)
- func (agg *Aggregate) GetInfo(ctx context.Context) (*protocol.RuntimeInfoResponse, error)
- func (agg *Aggregate) ID() common.Namespace
- func (agg *Aggregate) SetVersion(ctx context.Context, version version.Version) error
- func (agg *Aggregate) Start() error
- func (agg *Aggregate) Stop()
- func (agg *Aggregate) WatchEvents(ctx context.Context) (<-chan *host.Event, pubsub.ClosableSubscription, error)
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 ¶
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) Call ¶
func (agg *Aggregate) Call(ctx context.Context, body *protocol.Body) (rsp *protocol.Body, err error)
Implements host.Runtime.
func (*Aggregate) SetVersion ¶
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) WatchEvents ¶
func (agg *Aggregate) WatchEvents(ctx context.Context) (<-chan *host.Event, pubsub.ClosableSubscription, error)
Implements host.Runtime.
Click to show internal directories.
Click to hide internal directories.