<lambda>null1// This file was automatically generated from flow.md by Knit tool. Do not edit. 2 package kotlinx.coroutines.guide.exampleFlow37 3 4 import kotlinx.coroutines.* 5 import kotlinx.coroutines.flow.* 6 7 fun foo(): Flow<Int> = flow { 8 for (i in 1..5) { 9 println("Emitting $i") 10 emit(i) 11 } 12 } 13 <lambda>null14fun main() = runBlocking<Unit> { 15 foo().collect { value -> 16 if (value == 3) cancel() 17 println(value) 18 } 19 } 20