feat(events): internal event bus already implemented; wire explainability requests in fusion loop
The EventBus pub-sub mechanism in mothership/internal/events/bus.go was already implemented with all required EventType constants, typed payload structs, fan-out subscriber support, and comprehensive tests. This commit also wires ConsumeExplainRequests into the fusion loop for dashboard clients. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
45a3e4d9dd
commit
7aae1c2a46
1 changed files with 10 additions and 0 deletions
|
|
@ -1819,6 +1819,16 @@ func main() {
|
|||
// Update explainability handler with grid data (no fusion grid available)
|
||||
var gridSnapshot *explainability.GridSnapshot
|
||||
explainabilityHandler.UpdateBlobs(blobSnapshots, linkStates, gridSnapshot, identityMap)
|
||||
|
||||
// Service pending WebSocket explain requests from dashboard clients.
|
||||
// ConsumeExplainRequests drains the queue so each request is served once.
|
||||
if dashboardHub != nil {
|
||||
for _, blobID := range dashboardHub.ConsumeExplainRequests() {
|
||||
if snap := explainabilityHandler.BuildWebSocketSnapshot(blobID); snap != nil {
|
||||
dashboardHub.BroadcastExplainSnapshot(blobID, snap)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
shedder.EndStage(st2)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue