aggregate instance SSE streams through server bus so UI uses single connection

This commit is contained in:
Shantur Rathore
2025-11-23 19:07:10 +00:00
parent 8577b3d1e6
commit 1741e49568
6 changed files with 252 additions and 117 deletions

View File

@@ -8,7 +8,9 @@ export class EventBus extends EventEmitter {
}
publish(event: WorkspaceEventPayload): boolean {
this.logger?.debug({ event }, "Publishing workspace event")
if (event.type !== "instance.event" && event.type !== "instance.eventStatus") {
this.logger?.debug({ event }, "Publishing workspace event")
}
return super.emit(event.type, event)
}
@@ -22,6 +24,8 @@ export class EventBus extends EventEmitter {
this.on("config.appChanged", handler)
this.on("config.binariesChanged", handler)
this.on("instance.dataChanged", handler)
this.on("instance.event", handler)
this.on("instance.eventStatus", handler)
return () => {
this.off("workspace.created", handler)
this.off("workspace.started", handler)
@@ -31,6 +35,8 @@ export class EventBus extends EventEmitter {
this.off("config.appChanged", handler)
this.off("config.binariesChanged", handler)
this.off("instance.dataChanged", handler)
this.off("instance.event", handler)
this.off("instance.eventStatus", handler)
}
}
}