ANSI update

This commit is contained in:
2026-09-01 14:58:17 +02:00
parent 7f92df1ca5
commit 563ee98d03
7 changed files with 27 additions and 24 deletions
@@ -179,7 +179,6 @@ fun Application.module() {
) { _, id, sender ->
val bus = Buses.monitorBus(id)
val backlog = bus.onConnect()
println("Bus [$id] connected; sending backlog (${backlog.start != null} // ${backlog.messages.size} // ${backlog.end != null})")
sender(bus.bus.serializer, backlog)
bus.bus
}
@@ -11,21 +11,18 @@ class MutableBackLog<TStart, TEvent, TEnd> {
fun registerStart(event: TStart) {
if(start != null) throw IllegalStateException("Start is already set.")
start = event
println("[BACKLOG]: start '$event'")
}
fun onEvent(event: TEvent) {
if(start == null) throw IllegalStateException("Start is not set yet.")
if(end != null) throw IllegalStateException("End is already set.")
_events += event
println("[BACKLOG]: event '$event'")
}
fun registerEnd(event: TEnd) {
if(start == null) throw IllegalStateException("Start is not set yet.")
if(end != null) throw IllegalStateException("End is already set.")
end = event
println("[BACKLOG]: end '$event'")
}
fun reset() {