Delete the push and the declaration: the send stub and node holds, link declare and its order, the sent readers, and the sweep judged by compositions (release 6, issue 1945 B8)
This commit is contained in:
@@ -26,11 +26,6 @@ type Bus interface {
|
||||
// nobody is obliged to act (ADR 0041).
|
||||
PublishEvent(ctx context.Context, key, source, node string, body []byte) error
|
||||
|
||||
// PublishDeclaration delivers one node what it should be. Addressed to that node alone: a
|
||||
// declaration is not an event, and replaying yesterday's is actively harmful
|
||||
// (design 29 §4, the *state* shape).
|
||||
PublishDeclaration(ctx context.Context, node string, body []byte) error
|
||||
|
||||
// PublishSeatEvent states a fact under a role's own name, for the holder of that role. A
|
||||
// module's event is addressed to the module; a role's is addressed to the role, so it keeps
|
||||
// meaning when the holder changes (novox/hq ADR 0121, ADR 0129).
|
||||
@@ -101,11 +96,6 @@ func SeatEventSubject(seat, event string) string {
|
||||
return "mesh.seat." + seat + ".event." + event
|
||||
}
|
||||
|
||||
// DeclareSubject is where one node's declaration lands. Last-per-subject on the NODES stream, so
|
||||
// a node that was away gets exactly the current one and a replayed older one is refused by
|
||||
// sequence — the wire-level answer to novox/hq issue 107.
|
||||
func DeclareSubject(node string) string { return "mesh.node." + node + ".declare" }
|
||||
|
||||
func (b OverNATS) PublishEvent(ctx context.Context, key, source, node string, body []byte) error {
|
||||
id, err := eventID()
|
||||
if err != nil {
|
||||
@@ -192,14 +182,6 @@ func (b OverNATS) MaxPayload() int64 {
|
||||
return b.Conn.MaxPayload()
|
||||
}
|
||||
|
||||
func (b OverNATS) PublishDeclaration(ctx context.Context, node string, body []byte) error {
|
||||
_, err := b.JS.Publish(DeclareSubject(node), body, nats.Context(ctx))
|
||||
if err != nil {
|
||||
return fmt.Errorf("declaring to %s: %w", node, err)
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// ToolSubject is where a module answers. Derived from the module and the tool, so a caller names
|
||||
// what it wants rather than where it lives.
|
||||
func ToolSubject(module, tool string) string { return "mesh.mod." + module + ".tool." + tool }
|
||||
|
||||
Reference in New Issue
Block a user