The mesh issues an assignment's subjects: a membership per module on a machine (hq ADR 0160)
For every module on every machine the controller composes what that instance serves — its machine's address always, the module's plain address in a queue when it is alone or its definition says its instances are interchangeable — the verbs of the seats it holds at the seats' subjects, where its events land, and what it may reach, resolved the same way for the modules it invokes. Published beside the node's declaration on `mesh.assignment.<node>.<module>`, last per subject in a stream that allows direct reads, and the account may read exactly its own. Composed from the same records the bus's accounts are, so what a runtime serves and what its account may are one composition. `instances: interchangeable` is the one fact a definition states for it. The shape issued is the shape the mesh already had, so nothing moves when the membership arrives; the runtime that reads it instead of deriving it is the next piece.
This commit is contained in:
@@ -47,8 +47,14 @@ type Stream struct {
|
||||
// Why is carried into the assertion so an operator reading the server's own state finds the
|
||||
// reason there, rather than only in a repository they may not have.
|
||||
Why string
|
||||
// Direct lets a client read a subject's last message without a consumer, which is how a
|
||||
// runtime reads its own membership with no JetStream API beyond one request (ADR 0160).
|
||||
Direct bool
|
||||
}
|
||||
|
||||
// AssignmentsStream holds every assignment's membership, the newest per subject.
|
||||
const AssignmentsStream = "ASSIGNMENTS"
|
||||
|
||||
// MeshStreams is the foundation set, in the order a person reads it.
|
||||
//
|
||||
// **CONTROL names its subjects rather than taking `mesh.control.>`**, because heartbeats live
|
||||
@@ -78,6 +84,14 @@ func MeshStreams() []Stream {
|
||||
Why: "one declaration per node, always the newest; a node that sees sequence n refuses " +
|
||||
"n-1 by construction (issue 107)",
|
||||
},
|
||||
{
|
||||
Name: AssignmentsStream,
|
||||
Subjects: []string{"mesh.assignment.*.*"},
|
||||
Retention: RetentionLastPerSubject,
|
||||
Direct: true,
|
||||
Why: "one membership per assignment, always the newest: what the mesh issued this module " +
|
||||
"on this machine to serve and to reach (ADR 0160); read directly by the runtime it is for",
|
||||
},
|
||||
{
|
||||
Name: EventsStream,
|
||||
// A seat's own events ride here too: they are 1:many like any event, and the
|
||||
|
||||
Reference in New Issue
Block a user