The controller ended by its unassignment (ADR 0590), which supersedes the lease write and its hand-back whole and makes the grants part's list the only one the bus node follows. The lease write, its check, the removal marker, the take-over and hand-back asks, their five tools, the seat claim and the lease and takeover states had nothing left to act on; the membership notice on its subject had no reader. A whole-module test on the bus replaces the lease write's: with no controller at all, the part publishes a membership in its state alone, makes the module's consumer and writes the key the bus node follows. Claude-Session: https://claude.ai/code/session_01NcbgfJ9Gum47zkFKWRaovL
27 lines
685 B
Go
27 lines
685 B
Go
package main
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/nats-io/nats.go/jetstream"
|
|
|
|
"git.novox.be/novox/mesh-sdk/go/asks"
|
|
)
|
|
|
|
// sayVia says a condition of the part on its own subject, as a module that uses the seat operator-channel may: the
|
|
// account consumers that differ, a grant missing, a user list held, a principal refused.
|
|
func sayVia(ctx context.Context, js jetstream.JetStream, module string) func(c asks.Condition) error {
|
|
return func(c asks.Condition) error {
|
|
subject, err := asks.ConditionSubject(module)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
data, err := asks.EncodeCondition(c)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
_, err = js.Publish(ctx, subject, data)
|
|
return err
|
|
}
|
|
}
|