Don’t Block Suspend Functions
Here’s a program that launches 3 jobs. The first runs forever and the other two exchange a value. @Test fun test() = runTest { val channel = Channel<String>() val deferredA = async { while (isActive) { delay(1_000) } } val deferredB = async { channel.send("hello") } val deferredC = async { channel.receive() } deferredB.await(…