From 9b5e238820edb27190b9b3ea5d9a330d3b1f7e02 Mon Sep 17 00:00:00 2001 From: kami Date: Sun, 17 May 2026 14:25:36 +0400 Subject: [PATCH] fix(tui): run WS collectors on IO dispatcher so they aren't starved by runner.run --- apps/tui/src/main/kotlin/com/correx/apps/tui/TuiApp.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/apps/tui/src/main/kotlin/com/correx/apps/tui/TuiApp.kt b/apps/tui/src/main/kotlin/com/correx/apps/tui/TuiApp.kt index 05872a55..d9f5b070 100644 --- a/apps/tui/src/main/kotlin/com/correx/apps/tui/TuiApp.kt +++ b/apps/tui/src/main/kotlin/com/correx/apps/tui/TuiApp.kt @@ -63,12 +63,12 @@ fun main(args: Array) { } } - launch { + effectScope.launch { ws.messages.collect { msg -> runner.runOnRenderThread { dispatch(Action.ServerEventReceived(msg)) } } } - launch { + effectScope.launch { ws.connection.collect { ev -> val action = when (ev) { is ConnectionEvent.Connected -> Action.Connected @@ -78,7 +78,7 @@ fun main(args: Array) { runner.runOnRenderThread { dispatch(action) } } } - launch { ws.connect() } + effectScope.launch { ws.connect() } val handler = EventHandler { event, _ -> if (event is TambouiKeyEvent) {