Skip to content

Commit 75f634c

Browse files
committed
Reknit after docs fix
1 parent 3feef05 commit 75f634c

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

core/kotlinx-coroutines-core/test/guide/example-channel-04.kt

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,11 @@ fun main() = runBlocking {
1818
//sampleEnd
1919
}
2020

21-
fun CoroutineScope.produceSquares(): ReceiveChannel<Int> = produce {
22-
for (x in 1..5) send(x * x)
23-
}
24-
2521
fun CoroutineScope.produceNumbers() = produce<Int> {
2622
var x = 1
2723
while (true) send(x++) // infinite stream of integers starting from 1
2824
}
25+
2926
fun CoroutineScope.square(numbers: ReceiveChannel<Int>): ReceiveChannel<Int> = produce {
3027
for (x in numbers) send(x * x)
3128
}

0 commit comments

Comments
 (0)