mirror of
https://github.com/SlimeVR/SlimeVR-Server.git
synced 2026-11-20 09:01:20 -08:00
Better event-dispatcher with liteners that die with scope
This commit is contained in:
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 {
|
||||
|
||||
Reference in new issue
Block a user