Animesh Sahu
09/27/2020, 1:04 PMval ch = BroadcastChannel<Int>(Channel.CONFLATED)
var counter = 0
ch.asFlow().onEach { ++counter; yield() }.launchIn(this)
ch.offer(150) // send random element
yield()
counter shouldBeExactly 1
this
in launchIn() is TestContext of kotest framework: https://github.com/kotest/kotest (probably single threaded)
but I assume yielding will change the coroutine to the waiting coroutine, right?flosch
09/27/2020, 1:35 PMAnimesh Sahu
09/27/2020, 1:59 PM