blob: f280e8568f5c96999633110bbc8c3b612719858c [file] [log] [blame]
// This file was automatically generated from coroutines-guide.md by Knit tool. Do not edit.
package guide.channel.example03
import kotlinx.coroutines.experimental.*
import kotlinx.coroutines.experimental.channels.*
fun produceSquares() = buildChannel<Int>(CommonPool) {
for (x in 1..5) send(x * x)
}
fun main(args: Array<String>) = runBlocking<Unit> {
val squares = produceSquares()
for (y in squares) println(y)
println("Done!")
}