dave08
10/22/2018, 10:21 AMval progress = Channel<Long>(Channel.CONFLATED)
val progressList = GlobalScope.async { progress.toList() }
runBlocking {
val progressResult = (0L..20L step 2).onEach { progress.offer(it) }
progress.close()
assertThat(progressResult.toList()).toBe(progressList.await())
}
progressList
is []...gildor
10/22/2018, 10:26 AMdave08
10/22/2018, 10:27 AMgildor
10/22/2018, 10:29 AMdave08
10/22/2018, 10:30 AMdelay(20)
the test passes with send...send
should have suspended like you said?gildor
10/22/2018, 10:38 AMdave08
10/22/2018, 10:41 AMtoList()
return immediately while progress is still being sent..? I don't necessarily suspend while receiving bytes...gildor
10/22/2018, 11:31 AMdave08
10/22/2018, 11:34 AMgildor
10/22/2018, 11:37 AMdave08
10/22/2018, 11:39 AMgildor
10/22/2018, 12:27 PM