Skip to content

Commit f1572ca

Browse files
committed
Slow down example-reactive-basic-05.kt as a hack to make it more stable
1 parent 35af7c8 commit f1572ca

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

reactive/coroutines-guide-reactive.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,7 +350,7 @@ fun main(args: Array<String>) = runBlocking<Unit> {
350350
.doOnComplete { println("Complete") }
351351
.subscribe { x ->
352352
println("Received $x")
353-
Thread.sleep(200) // 200 ms to process each item
353+
Thread.sleep(300) // 300 ms to process each item
354354
}
355355
delay(2000) // suspend main thread for couple of seconds
356356
}

reactive/kotlinx-coroutines-rx2/src/test/kotlin/guide/example-reactive-basic-05.kt

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,9 @@
1717
// This file was automatically generated from coroutines-guide-reactive.md by Knit tool. Do not edit.
1818
package guide.reactive.basic.example05
1919

20-
import io.reactivex.schedulers.Schedulers
21-
import kotlinx.coroutines.experimental.delay
22-
import kotlinx.coroutines.experimental.runBlocking
20+
import kotlinx.coroutines.experimental.*
2321
import kotlinx.coroutines.experimental.rx2.rxFlowable
22+
import io.reactivex.schedulers.Schedulers
2423

2524
fun main(args: Array<String>) = runBlocking<Unit> {
2625
// coroutine -- fast producer of elements in the context of the main thread
@@ -36,7 +35,7 @@ fun main(args: Array<String>) = runBlocking<Unit> {
3635
.doOnComplete { println("Complete") }
3736
.subscribe { x ->
3837
println("Received $x")
39-
Thread.sleep(200) // 200 ms to process each item
38+
Thread.sleep(300) // 300 ms to process each item
4039
}
4140
delay(2000) // suspend main thread for couple of seconds
4241
}

0 commit comments

Comments
 (0)