File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed
core/kotlinx-coroutines-core/src/test/kotlin/guide Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -29,8 +29,8 @@ fun produceNumbers() = produce<Int> {
29
29
}
30
30
31
31
fun launchProcessor (id : Int , channel : ReceiveChannel <Int >) = launch {
32
- channel.consumeEach {
33
- println (" Processor #$id received $it " )
32
+ for (msg in channel) {
33
+ println (" Processor #$id received $msg " )
34
34
}
35
35
}
36
36
Original file line number Diff line number Diff line change @@ -1531,8 +1531,8 @@ received number:
1531
1531
1532
1532
``` kotlin
1533
1533
fun launchProcessor (id : Int , channel : ReceiveChannel <Int >) = launch {
1534
- channel.consumeEach {
1535
- println (" Processor #$id received $it " )
1534
+ for (msg in channel) {
1535
+ println (" Processor #$id received $msg " )
1536
1536
}
1537
1537
}
1538
1538
```
You can’t perform that action at this time.
0 commit comments