Roman Elizarov | 3258e1f | 2019-08-22 20:08:48 +0300 | [diff] [blame] | 1 | /* |
Roman Elizarov | 660c2d7 | 2020-02-14 13:18:37 +0300 | [diff] [blame] | 2 | * Copyright 2016-2020 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license. |
Roman Elizarov | 3258e1f | 2019-08-22 20:08:48 +0300 | [diff] [blame] | 3 | */ |
| 4 | |
Roman Elizarov | 660c2d7 | 2020-02-14 13:18:37 +0300 | [diff] [blame] | 5 | // This file was automatically generated from flow.md by Knit tool. Do not edit. |
| 6 | package kotlinx.coroutines.guide.exampleFlow31 |
Roman Elizarov | 3258e1f | 2019-08-22 20:08:48 +0300 | [diff] [blame] | 7 | |
| 8 | import kotlinx.coroutines.* |
| 9 | import kotlinx.coroutines.flow.* |
| 10 | |
| 11 | fun foo(): Flow<Int> = (1..3).asFlow() |
| 12 | |
| 13 | fun main() = runBlocking<Unit> { |
| 14 | try { |
| 15 | foo().collect { value -> println(value) } |
| 16 | } finally { |
| 17 | println("Done") |
| 18 | } |
| 19 | } |