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> {
2929}
3030
3131fun 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 " )
3434 }
3535}
3636
Original file line number Diff line number Diff line change @@ -1531,8 +1531,8 @@ received number:
15311531
15321532``` kotlin
15331533fun 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 " )
15361536 }
15371537}
15381538```
You can’t perform that action at this time.
0 commit comments