1 // This file was automatically generated from channels.md by Knit tool. Do not edit. 2 package kotlinx.coroutines.guide.exampleChannel03 3 4 import kotlinx.coroutines.* 5 import kotlinx.coroutines.channels.* 6 <lambda>null7fun CoroutineScope.produceSquares(): ReceiveChannel<Int> = produce { 8 for (x in 1..5) send(x * x) 9 } 10 <lambda>null11fun main() = runBlocking { 12 val squares = produceSquares() 13 squares.consumeEach { println(it) } 14 println("Done!") 15 } 16