The node seat node-engine served on the engine's link: its verbs with their proven caller, its acts kept in its own state, a hand-over or access act asked of the operator as node-engine-<node> and performed only on the warrant (issue 774, ADR 0563 §1-§3)
This commit is contained in:
@@ -9,6 +9,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/nats-io/nats.go"
|
||||
"github.com/nats-io/nats.go/micro"
|
||||
)
|
||||
|
||||
// The host's link on the bus: one connection, and what is asked of this node over it. The node hears no declaration
|
||||
@@ -48,7 +49,10 @@ type natsLink struct {
|
||||
acting *nats.Subscription
|
||||
// moving hears the controller asking to move a value sealed to this machine into the vault (issue 676).
|
||||
moving *nats.Subscription
|
||||
node string
|
||||
// engine serves the node seat node-engine, and warrants hears the operator's answers to its asks (ADR 0563).
|
||||
engine micro.Service
|
||||
warrants *nats.Subscription
|
||||
node string
|
||||
// signer is the mesh's key, which a hand-over ask is verified with as a declaration is (issue 356).
|
||||
signer ed25519.PublicKey
|
||||
lost chan error
|
||||
@@ -258,6 +262,12 @@ func (l *natsLink) Close() {
|
||||
if l.judging != nil {
|
||||
_ = l.judging.Unsubscribe()
|
||||
}
|
||||
if l.engine != nil {
|
||||
_ = l.engine.Stop()
|
||||
}
|
||||
if l.warrants != nil {
|
||||
_ = l.warrants.Unsubscribe()
|
||||
}
|
||||
if l.conn != nil {
|
||||
l.conn.Close()
|
||||
}
|
||||
@@ -301,10 +311,12 @@ func (l *natsLink) Ask(ctx context.Context, subject string, body []byte) ([]byte
|
||||
// What the queue asks of a live link beside Bus, each by a type assertion that fails quietly: said here
|
||||
// so a link that drops one does not build.
|
||||
var (
|
||||
_ Bus = (*natsLink)(nil)
|
||||
_ HealthBus = (*natsLink)(nil)
|
||||
_ HaveBus = (*natsLink)(nil)
|
||||
_ ToolBus = (*natsLink)(nil)
|
||||
_ Asker = (*natsLink)(nil)
|
||||
_ Asked = (*natsLink)(nil)
|
||||
_ Bus = (*natsLink)(nil)
|
||||
_ HealthBus = (*natsLink)(nil)
|
||||
_ HaveBus = (*natsLink)(nil)
|
||||
_ ToolBus = (*natsLink)(nil)
|
||||
_ Asker = (*natsLink)(nil)
|
||||
_ Asked = (*natsLink)(nil)
|
||||
_ EngineSeats = (*natsLink)(nil)
|
||||
_ OperatorAsks = (*natsLink)(nil)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user