Better event-dispatcher with liteners that die with scope

This commit is contained in:
lucas lelievre committed 2026-07-23 22:04:49 +02:00
1 parent 8e19542c82
commit 05fbf64ac3
35 files changed
+174 -174

No files matched your search

@@ -19,6 +19,7 @@ import io.ktor.websocket.Frame
import kotlinx.coroutines.awaitCancellation
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.flow.flow
import kotlinx.coroutines.flow.launchIn
import solarxr_protocol.MessageBundle
import java.nio.ByteBuffer
@@ -44,7 +45,7 @@ suspend fun createAndroidSolarXRWebsocketServer(appContext: AppContextProvider)
val fbb = FlatBufferBuilder(256)
fbb.finish(bundle.encode(JvmFlatBufferWriter(fbb)))
send(Frame.Binary(fin = true, data = fbb.dataBuffer().moveToByteArray()))
}
}.launchIn(this)
try {
flow {