(Please redirect me if this should be in <#C0B8MA7...
# coroutines
n
(Please redirect me if this should be in #getting-started). I'm jumping in way over my head and trying to do a multiplayer game server for my first Kotlin project. I'm trying to use Ktor Websockets for client-server communication. It's my understanding that i can run the 'core game loop' as a separate coroutine and then communicate with the client websocket coroutines via channels, am i going in the right direction? My game loop does not need to be very fast at all so i'm assuming i can comfortably
delay
back to the client websocket coroutines relatively frequently to look for new input
b
You can use channels (hot) ir flows (cold) for that
I'd run your main game loop on Dispatchers.Main and collect from a channel when needed that's produced by some pool of background coroutines on Dispatchers.Default
n
Thanks for the advice, I'll take a look into that