CAT-CC3: claude-code reads the indexer's modules and manifests and the assigner's placement from their first views and views events, never their state (ADR 0615 §1)
Claude-Session: https://claude.ai/code/session_01JG73KJNrH5EgFXMKKYSrig
This commit is contained in:
@@ -334,13 +334,23 @@ func guardFiles(p Paths, m *MeshTools) *GuardFiles {
|
||||
return &GuardFiles{Exe: exe, Data: GuardDataOf(p, m), WaitsDir: WaitsDirPath(p)}
|
||||
}
|
||||
|
||||
// MeshToolsEvery is how often the bus is read again.
|
||||
// MeshToolsEvery is how often the machines' addresses are resolved again; the tools and the placement are read again
|
||||
// when their followed states change (a views event), not on this timer.
|
||||
const MeshToolsEvery = 10 * time.Minute
|
||||
|
||||
// refreshMeshTools reads the bus at start and every few minutes, and renders when what it said changed.
|
||||
// MeshToolsFirst is how long the first read waits for the first views to be answered.
|
||||
const MeshToolsFirst = 2 * time.Minute
|
||||
|
||||
// refreshMeshTools reads the pictures once the first views are answered, and again whenever one changes (and the
|
||||
// machines' addresses every few minutes), and renders when what it said changed.
|
||||
func refreshMeshTools(p Paths) {
|
||||
select {
|
||||
case <-meshViews.Ready():
|
||||
case <-time.After(MeshToolsFirst):
|
||||
say("the first views of the tools and the placement were not answered in %s; reading what is held", MeshToolsFirst)
|
||||
}
|
||||
for {
|
||||
m, err := ReadMeshToolsFrom(busStates{}, seats.List(), lookup)
|
||||
m, err := ReadMeshToolsFrom(viewStates{meshViews}, seats.List(), lookup)
|
||||
if err != nil {
|
||||
say("reading what each tool replaces and which machines the mesh has: %v", err)
|
||||
}
|
||||
@@ -351,7 +361,15 @@ func refreshMeshTools(p Paths) {
|
||||
say("the mesh's tools changed: %d replace a command, %d machines; rendered", len(m.Replacements), len(m.Machines))
|
||||
}
|
||||
}
|
||||
time.Sleep(MeshToolsEvery)
|
||||
select {
|
||||
case <-meshChanged:
|
||||
time.Sleep(2 * time.Second) // a burst of events is one read
|
||||
select {
|
||||
case <-meshChanged:
|
||||
default:
|
||||
}
|
||||
case <-time.After(MeshToolsEvery):
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user