https://kotlinlang.org logo
Title
s

sailxjx

11/15/2017, 8:24 AM
I read these messages into a concurrent queue, and another thread (this is handled by the connect framework) will poll this queue and release the memory.
sleep
can avoid putting too many messages in the queue.
u

uli

11/15/2017, 8:18 PM
Send the messages via a coroutine channel. Instead of concurrent queues. The channel can be limited in size and will suspend your coroutine until more space becomes available. No blocking, no sleep, no delay: https://github.com/Kotlin/kotlinx.coroutines/blob/master/coroutines-guide.md#channels