Skip to content

Commit a027d68

Browse files
committed
Merge branch 'master' into develop
2 parents 41b4665 + c8ef9ec commit a027d68

File tree

2 files changed

+10
-10
lines changed

2 files changed

+10
-10
lines changed

docs/topics/select-expression.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -13,23 +13,23 @@ the first one that becomes available.
1313

1414
## Selecting from channels
1515

16-
Let us have two producers of strings: `fizz` and `buzz`. The `fizz` produces "Fizz" string every 300 ms:
16+
Let us have two producers of strings: `fizz` and `buzz`. The `fizz` produces "Fizz" string every 500 ms:
1717

1818
```kotlin
1919
fun CoroutineScope.fizz() = produce<String> {
20-
while (true) { // sends "Fizz" every 300 ms
21-
delay(300)
20+
while (true) { // sends "Fizz" every 500 ms
21+
delay(500)
2222
send("Fizz")
2323
}
2424
}
2525
```
2626

27-
And the `buzz` produces "Buzz!" string every 500 ms:
27+
And the `buzz` produces "Buzz!" string every 1000 ms:
2828

2929
```kotlin
3030
fun CoroutineScope.buzz() = produce<String> {
31-
while (true) { // sends "Buzz!" every 500 ms
32-
delay(500)
31+
while (true) { // sends "Buzz!" every 1000 ms
32+
delay(1000)
3333
send("Buzz!")
3434
}
3535
}
@@ -62,14 +62,14 @@ import kotlinx.coroutines.channels.*
6262
import kotlinx.coroutines.selects.*
6363

6464
fun CoroutineScope.fizz() = produce<String> {
65-
while (true) { // sends "Fizz" every 300 ms
65+
while (true) { // sends "Fizz" every 500 ms
6666
delay(500)
6767
send("Fizz")
6868
}
6969
}
7070

7171
fun CoroutineScope.buzz() = produce<String> {
72-
while (true) { // sends "Buzz!" every 500 ms
72+
while (true) { // sends "Buzz!" every 1000 ms
7373
delay(1000)
7474
send("Buzz!")
7575
}

kotlinx-coroutines-core/jvm/test/guide/example-select-01.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ import kotlinx.coroutines.channels.*
1010
import kotlinx.coroutines.selects.*
1111

1212
fun CoroutineScope.fizz() = produce<String> {
13-
while (true) { // sends "Fizz" every 300 ms
13+
while (true) { // sends "Fizz" every 500 ms
1414
delay(500)
1515
send("Fizz")
1616
}
1717
}
1818

1919
fun CoroutineScope.buzz() = produce<String> {
20-
while (true) { // sends "Buzz!" every 500 ms
20+
while (true) { // sends "Buzz!" every 1000 ms
2121
delay(1000)
2222
send("Buzz!")
2323
}

0 commit comments

Comments
 (0)