Structured concurrency for reactive modules
* Deprecated API older than 6 months removed
* Standalone builders are deprecated
* Guide and readme updated
diff --git a/reactive/kotlinx-coroutines-rx2/test/ConvertTest.kt b/reactive/kotlinx-coroutines-rx2/test/ConvertTest.kt
index 8b7fbfc..5284725 100644
--- a/reactive/kotlinx-coroutines-rx2/test/ConvertTest.kt
+++ b/reactive/kotlinx-coroutines-rx2/test/ConvertTest.kt
@@ -13,9 +13,9 @@
class TestException(s: String): RuntimeException(s)
@Test
- fun testToCompletableSuccess() = runBlocking<Unit> {
+ fun testToCompletableSuccess() = runBlocking {
expect(1)
- val job = launch(coroutineContext) {
+ val job = launch {
expect(3)
}
val completable = job.asCompletable(coroutineContext)
@@ -28,9 +28,9 @@
}
@Test
- fun testToCompletableFail() = runBlocking<Unit> {
+ fun testToCompletableFail() = runBlocking {
expect(1)
- val job = async(coroutineContext + NonCancellable) { // don't kill parent on exception
+ val job = async(NonCancellable) { // don't kill parent on exception
expect(3)
throw RuntimeException("OK")
}
@@ -121,7 +121,7 @@
@Test
fun testToObservable() {
- val c = GlobalScope.produce(DefaultDispatcher) {
+ val c = GlobalScope.produce {
delay(50)
send("O")
delay(50)
@@ -135,14 +135,14 @@
@Test
fun testToObservableFail() {
- val c = GlobalScope.produce(DefaultDispatcher) {
+ val c = GlobalScope.produce {
delay(50)
send("O")
delay(50)
throw TestException("K")
}
val observable = c.asObservable(Unconfined)
- val single = rxSingle(Unconfined) {
+ val single = GlobalScope.rxSingle(Unconfined) {
var result = ""
try {
observable.consumeEach { result += it }