Renamed all toXXX converted in reactive streams libraries to asXXX
diff --git a/reactive/kotlinx-coroutines-reactive/README.md b/reactive/kotlinx-coroutines-reactive/README.md
index 54b3728..2c30254 100644
--- a/reactive/kotlinx-coroutines-reactive/README.md
+++ b/reactive/kotlinx-coroutines-reactive/README.md
@@ -22,7 +22,7 @@
| **Name** | **Description**
| -------- | ---------------
-| [ReceiveChannel.toPublisher][kotlinx.coroutines.experimental.channels.ReceiveChannel.toPublisher] | Converts streaming channel to hot publisher
+| [ReceiveChannel.asPublisher][kotlinx.coroutines.experimental.channels.ReceiveChannel.asPublisher] | Converts streaming channel to hot publisher
<!--- SITE_ROOT https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core -->
<!--- DOCS_ROOT kotlinx-coroutines-core/target/dokka/kotlinx-coroutines-core -->
@@ -32,14 +32,14 @@
[ReceiveChannel]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/-receive-channel/index.html
[ChannelIterator]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/-channel-iterator/index.html
<!--- SITE_ROOT https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-reactive -->
-<!--- DOCS_ROOT kotlinx-coroutines-reactive/target/dokka/kotlinx-coroutines-reactive -->
+<!--- DOCS_ROOT reactive/kotlinx-coroutines-reactive/target/dokka/kotlinx-coroutines-reactive -->
<!--- INDEX kotlinx.coroutines.experimental.reactive -->
[publish]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-reactive/kotlinx.coroutines.experimental.reactive/publish.html
[org.reactivestreams.Publisher.awaitFirst]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-reactive/kotlinx.coroutines.experimental.reactive/org.reactivestreams.-publisher/await-first.html
[org.reactivestreams.Publisher.awaitSingle]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-reactive/kotlinx.coroutines.experimental.reactive/org.reactivestreams.-publisher/await-single.html
[org.reactivestreams.Publisher.open]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-reactive/kotlinx.coroutines.experimental.reactive/org.reactivestreams.-publisher/open.html
[org.reactivestreams.Publisher.iterator]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-reactive/kotlinx.coroutines.experimental.reactive/org.reactivestreams.-publisher/iterator.html
-[kotlinx.coroutines.experimental.channels.ReceiveChannel.toPublisher]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-reactive/kotlinx.coroutines.experimental.reactive/kotlinx.coroutines.experimental.channels.-receive-channel/to-publisher.html
+[kotlinx.coroutines.experimental.channels.ReceiveChannel.asPublisher]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-reactive/kotlinx.coroutines.experimental.reactive/kotlinx.coroutines.experimental.channels.-receive-channel/as-publisher.html
<!--- END -->
# Package kotlinx.coroutines.experimental.reactive
diff --git a/reactive/kotlinx-coroutines-reactive/src/main/kotlin/kotlinx/coroutines/experimental/reactive/Convert.kt b/reactive/kotlinx-coroutines-reactive/src/main/kotlin/kotlinx/coroutines/experimental/reactive/Convert.kt
index 1a290c7..1dbec54 100644
--- a/reactive/kotlinx-coroutines-reactive/src/main/kotlin/kotlinx/coroutines/experimental/reactive/Convert.kt
+++ b/reactive/kotlinx-coroutines-reactive/src/main/kotlin/kotlinx/coroutines/experimental/reactive/Convert.kt
@@ -28,7 +28,14 @@
*
* @param context -- the coroutine context from which the resulting observable is going to be signalled
*/
-public fun <T> ReceiveChannel<T>.toPublisher(context: CoroutineContext): Publisher<T> = publish(context) {
- for (t in this@toPublisher)
+public fun <T> ReceiveChannel<T>.asPublisher(context: CoroutineContext): Publisher<T> = publish(context) {
+ for (t in this@asPublisher)
send(t)
}
+
+/**
+ * @suppress **Deprecated**: Renamed to [asPublisher]
+ */
+@Deprecated(message = "Renamed to `asPublisher`",
+ replaceWith = ReplaceWith("asPublisher(context)"))
+public fun <T> ReceiveChannel<T>.toPublisher(context: CoroutineContext): Publisher<T> = asPublisher(context)
\ No newline at end of file
diff --git a/reactive/kotlinx-coroutines-reactive/src/test/kotlin/kotlinx/coroutines/experimental/reactive/IntegrationTest.kt b/reactive/kotlinx-coroutines-reactive/src/test/kotlin/kotlinx/coroutines/experimental/reactive/IntegrationTest.kt
index 7c95386..a794864 100644
--- a/reactive/kotlinx-coroutines-reactive/src/test/kotlin/kotlinx/coroutines/experimental/reactive/IntegrationTest.kt
+++ b/reactive/kotlinx-coroutines-reactive/src/test/kotlin/kotlinx/coroutines/experimental/reactive/IntegrationTest.kt
@@ -87,7 +87,7 @@
}
checkNumbers(n, pub)
val channel = pub.open()
- checkNumbers(n, channel.toPublisher(ctx(context)))
+ checkNumbers(n, channel.asPublisher(ctx(context)))
channel.close()
}
diff --git a/reactive/kotlinx-coroutines-rx1/README.md b/reactive/kotlinx-coroutines-rx1/README.md
index 55bc4da..3b23c07 100644
--- a/reactive/kotlinx-coroutines-rx1/README.md
+++ b/reactive/kotlinx-coroutines-rx1/README.md
@@ -25,9 +25,9 @@
| **Name** | **Description**
| -------- | ---------------
-| [Job.toCompletable][kotlinx.coroutines.experimental.Job.toCompletable] | Converts job to hot completable
-| [Deferred.toSingle][kotlinx.coroutines.experimental.Deferred.toSingle] | Converts deferred value to hot single
-| [ReceiveChannel.toObservable][kotlinx.coroutines.experimental.channels.ReceiveChannel.toObservable] | Converts streaming channel to hot observable
+| [Job.asCompletable][kotlinx.coroutines.experimental.Job.asCompletable] | Converts job to hot completable
+| [Deferred.asSingle][kotlinx.coroutines.experimental.Deferred.asSingle] | Converts deferred value to hot single
+| [ReceiveChannel.asObservable][kotlinx.coroutines.experimental.channels.ReceiveChannel.asObservable] | Converts streaming channel to hot observable
<!--- SITE_ROOT https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core -->
<!--- DOCS_ROOT kotlinx-coroutines-core/target/dokka/kotlinx-coroutines-core -->
@@ -38,7 +38,7 @@
[ReceiveChannel]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/-receive-channel/index.html
[ChannelIterator]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/-channel-iterator/index.html
<!--- SITE_ROOT https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-rx1 -->
-<!--- DOCS_ROOT kotlinx-coroutines-rx1/target/dokka/kotlinx-coroutines-rx1 -->
+<!--- DOCS_ROOT reactive/kotlinx-coroutines-rx1/target/dokka/kotlinx-coroutines-rx1 -->
<!--- INDEX kotlinx.coroutines.experimental.rx1 -->
[rxCompletable]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-rx1/kotlinx.coroutines.experimental.rx1/rx-completable.html
[rxSingle]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-rx1/kotlinx.coroutines.experimental.rx1/rx-single.html
@@ -48,9 +48,9 @@
[rx.Observable.awaitSingle]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-rx1/kotlinx.coroutines.experimental.rx1/rx.-observable/await-single.html
[rx.Observable.open]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-rx1/kotlinx.coroutines.experimental.rx1/rx.-observable/open.html
[rx.Observable.iterator]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-rx1/kotlinx.coroutines.experimental.rx1/rx.-observable/iterator.html
-[kotlinx.coroutines.experimental.Job.toCompletable]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-rx1/kotlinx.coroutines.experimental.rx1/kotlinx.coroutines.experimental.-job/to-completable.html
-[kotlinx.coroutines.experimental.Deferred.toSingle]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-rx1/kotlinx.coroutines.experimental.rx1/kotlinx.coroutines.experimental.-deferred/to-single.html
-[kotlinx.coroutines.experimental.channels.ReceiveChannel.toObservable]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-rx1/kotlinx.coroutines.experimental.rx1/kotlinx.coroutines.experimental.channels.-receive-channel/to-observable.html
+[kotlinx.coroutines.experimental.Job.asCompletable]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-rx1/kotlinx.coroutines.experimental.rx1/kotlinx.coroutines.experimental.-job/as-completable.html
+[kotlinx.coroutines.experimental.Deferred.asSingle]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-rx1/kotlinx.coroutines.experimental.rx1/kotlinx.coroutines.experimental.-deferred/as-single.html
+[kotlinx.coroutines.experimental.channels.ReceiveChannel.asObservable]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-rx1/kotlinx.coroutines.experimental.rx1/kotlinx.coroutines.experimental.channels.-receive-channel/as-observable.html
<!--- END -->
# Package kotlinx.coroutines.experimental.rx1
diff --git a/reactive/kotlinx-coroutines-rx1/src/main/kotlin/kotlinx/coroutines/experimental/rx1/RxConvert.kt b/reactive/kotlinx-coroutines-rx1/src/main/kotlin/kotlinx/coroutines/experimental/rx1/RxConvert.kt
index 4d3f6f4..e068680 100644
--- a/reactive/kotlinx-coroutines-rx1/src/main/kotlin/kotlinx/coroutines/experimental/rx1/RxConvert.kt
+++ b/reactive/kotlinx-coroutines-rx1/src/main/kotlin/kotlinx/coroutines/experimental/rx1/RxConvert.kt
@@ -31,8 +31,8 @@
*
* @param context -- the coroutine context from which the resulting completable is going to be signalled
*/
-public fun Job.toCompletable(context: CoroutineContext): Completable = rxCompletable(context) {
- this@toCompletable.join()
+public fun Job.asCompletable(context: CoroutineContext): Completable = rxCompletable(context) {
+ this@asCompletable.join()
}
/**
@@ -44,8 +44,8 @@
*
* @param context -- the coroutine context from which the resulting single is going to be signalled
*/
-public fun <T> Deferred<T>.toSingle(context: CoroutineContext): Single<T> = rxSingle<T>(context) {
- this@toSingle.await()
+public fun <T> Deferred<T>.asSingle(context: CoroutineContext): Single<T> = rxSingle<T>(context) {
+ this@asSingle.await()
}
/**
@@ -56,7 +56,28 @@
*
* @param context -- the coroutine context from which the resulting observable is going to be signalled
*/
-public fun <T> ReceiveChannel<T>.toObservable(context: CoroutineContext): Observable<T> = rxObservable(context) {
- for (t in this@toObservable)
+public fun <T> ReceiveChannel<T>.asObservable(context: CoroutineContext): Observable<T> = rxObservable(context) {
+ for (t in this@asObservable)
send(t)
}
+
+/**
+ * @suppress **Deprecated**: Renamed to [asCompletable]
+ */
+@Deprecated(message = "Renamed to `asCompletable`",
+ replaceWith = ReplaceWith("asCompletable(context)"))
+public fun Job.toCompletable(context: CoroutineContext): Completable = asCompletable(context)
+
+/**
+ * @suppress **Deprecated**: Renamed to [asSingle]
+ */
+@Deprecated(message = "Renamed to `asSingle`",
+ replaceWith = ReplaceWith("asSingle(context)"))
+public fun <T> Deferred<T>.toSingle(context: CoroutineContext): Single<T> = asSingle(context)
+
+/**
+ * @suppress **Deprecated**: Renamed to [asObservable]
+ */
+@Deprecated(message = "Renamed to `asObservable`",
+ replaceWith = ReplaceWith("asObservable(context)"))
+public fun <T> ReceiveChannel<T>.toObservable(context: CoroutineContext): Observable<T> = asObservable(context)
diff --git a/reactive/kotlinx-coroutines-rx1/src/test/kotlin/kotlinx/coroutines/experimental/rx1/ConvertTest.kt b/reactive/kotlinx-coroutines-rx1/src/test/kotlin/kotlinx/coroutines/experimental/rx1/ConvertTest.kt
index 9f2bae1..32ea56f 100644
--- a/reactive/kotlinx-coroutines-rx1/src/test/kotlin/kotlinx/coroutines/experimental/rx1/ConvertTest.kt
+++ b/reactive/kotlinx-coroutines-rx1/src/test/kotlin/kotlinx/coroutines/experimental/rx1/ConvertTest.kt
@@ -20,9 +20,8 @@
import kotlinx.coroutines.experimental.channels.produce
import org.hamcrest.core.IsEqual
import org.hamcrest.core.IsInstanceOf
-import org.junit.Assert.*
+import org.junit.Assert.assertThat
import org.junit.Test
-import java.io.IOException
class ConvertTest : TestBase() {
class TestException(s: String): RuntimeException(s)
@@ -33,7 +32,7 @@
val job = launch(context) {
expect(3)
}
- val completable = job.toCompletable(context)
+ val completable = job.asCompletable(context)
completable.subscribe {
expect(4)
}
@@ -49,7 +48,7 @@
expect(3)
throw RuntimeException("OK")
}
- val completable = job.toCompletable(context)
+ val completable = job.asCompletable(context)
completable.subscribe {
expect(4)
}
@@ -64,11 +63,11 @@
delay(50)
"OK"
}
- val single1 = d.toSingle(Unconfined)
+ val single1 = d.asSingle(Unconfined)
checkSingleValue(single1) {
assertThat(it, IsEqual("OK"))
}
- val single2 = d.toSingle(Unconfined)
+ val single2 = d.asSingle(Unconfined)
checkSingleValue(single2) {
assertThat(it, IsEqual("OK"))
}
@@ -80,12 +79,12 @@
delay(50)
throw TestException("OK")
}
- val single1 = d.toSingle(Unconfined)
+ val single1 = d.asSingle(Unconfined)
checkErroneous(single1) {
assertThat(it, IsInstanceOf(TestException::class.java))
assertThat(it.message, IsEqual("OK"))
}
- val single2 = d.toSingle(Unconfined)
+ val single2 = d.asSingle(Unconfined)
checkErroneous(single2) {
assertThat(it, IsInstanceOf(TestException::class.java))
assertThat(it.message, IsEqual("OK"))
@@ -100,7 +99,7 @@
delay(50)
send("K")
}
- val observable = c.toObservable(Unconfined)
+ val observable = c.asObservable(Unconfined)
checkSingleValue(observable.reduce { t1, t2 -> t1 + t2 }) {
assertThat(it, IsEqual("OK"))
}
@@ -114,7 +113,7 @@
delay(50)
throw TestException("K")
}
- val observable = c.toObservable(Unconfined)
+ val observable = c.asObservable(Unconfined)
val single = rxSingle(Unconfined) {
var result = ""
try {
diff --git a/reactive/kotlinx-coroutines-rx2/README.md b/reactive/kotlinx-coroutines-rx2/README.md
index 0322a4a..ffdc929 100644
--- a/reactive/kotlinx-coroutines-rx2/README.md
+++ b/reactive/kotlinx-coroutines-rx2/README.md
@@ -30,9 +30,9 @@
| **Name** | **Description**
| -------- | ---------------
-| [Job.toCompletable][kotlinx.coroutines.experimental.Job.toCompletable] | Converts job to hot completable
-| [Deferred.toSingle][kotlinx.coroutines.experimental.Deferred.toSingle] | Converts deferred value to hot single
-| [ReceiveChannel.toObservable][kotlinx.coroutines.experimental.channels.ReceiveChannel.toObservable] | Converts streaming channel to hot observable
+| [Job.asCompletable][kotlinx.coroutines.experimental.Job.asCompletable] | Converts job to hot completable
+| [Deferred.asSingle][kotlinx.coroutines.experimental.Deferred.asSingle] | Converts deferred value to hot single
+| [ReceiveChannel.asObservable][kotlinx.coroutines.experimental.channels.ReceiveChannel.asObservable] | Converts streaming channel to hot observable
<!--- SITE_ROOT https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core -->
<!--- DOCS_ROOT kotlinx-coroutines-core/target/dokka/kotlinx-coroutines-core -->
@@ -43,7 +43,7 @@
[ReceiveChannel]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/-receive-channel/index.html
[ChannelIterator]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.experimental.channels/-channel-iterator/index.html
<!--- SITE_ROOT https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-rx2 -->
-<!--- DOCS_ROOT kotlinx-coroutines-rx2/target/dokka/kotlinx-coroutines-rx2 -->
+<!--- DOCS_ROOT reactive/kotlinx-coroutines-rx2/target/dokka/kotlinx-coroutines-rx2 -->
<!--- INDEX kotlinx.coroutines.experimental.rx2 -->
[rxCompletable]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-rx2/kotlinx.coroutines.experimental.rx2/rx-completable.html
[rxSingle]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-rx2/kotlinx.coroutines.experimental.rx2/rx-single.html
@@ -54,9 +54,9 @@
[io.reactivex.ObservableSource.awaitSingle]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-rx2/kotlinx.coroutines.experimental.rx2/io.reactivex.-observable-source/await-single.html
[io.reactivex.ObservableSource.open]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-rx2/kotlinx.coroutines.experimental.rx2/io.reactivex.-observable-source/open.html
[io.reactivex.ObservableSource.iterator]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-rx2/kotlinx.coroutines.experimental.rx2/io.reactivex.-observable-source/iterator.html
-[kotlinx.coroutines.experimental.Job.toCompletable]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-rx2/kotlinx.coroutines.experimental.rx2/kotlinx.coroutines.experimental.-job/to-completable.html
-[kotlinx.coroutines.experimental.Deferred.toSingle]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-rx2/kotlinx.coroutines.experimental.rx2/kotlinx.coroutines.experimental.-deferred/to-single.html
-[kotlinx.coroutines.experimental.channels.ReceiveChannel.toObservable]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-rx2/kotlinx.coroutines.experimental.rx2/kotlinx.coroutines.experimental.channels.-receive-channel/to-observable.html
+[kotlinx.coroutines.experimental.Job.asCompletable]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-rx2/kotlinx.coroutines.experimental.rx2/kotlinx.coroutines.experimental.-job/as-completable.html
+[kotlinx.coroutines.experimental.Deferred.asSingle]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-rx2/kotlinx.coroutines.experimental.rx2/kotlinx.coroutines.experimental.-deferred/as-single.html
+[kotlinx.coroutines.experimental.channels.ReceiveChannel.asObservable]: https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-rx2/kotlinx.coroutines.experimental.rx2/kotlinx.coroutines.experimental.channels.-receive-channel/as-observable.html
<!--- END -->
# Package kotlinx.coroutines.experimental.rx2
diff --git a/reactive/kotlinx-coroutines-rx2/src/main/kotlin/kotlinx/coroutines/experimental/rx2/RxConvert.kt b/reactive/kotlinx-coroutines-rx2/src/main/kotlin/kotlinx/coroutines/experimental/rx2/RxConvert.kt
index ad97366..ffc9404 100644
--- a/reactive/kotlinx-coroutines-rx2/src/main/kotlin/kotlinx/coroutines/experimental/rx2/RxConvert.kt
+++ b/reactive/kotlinx-coroutines-rx2/src/main/kotlin/kotlinx/coroutines/experimental/rx2/RxConvert.kt
@@ -36,8 +36,8 @@
*
* @param context -- the coroutine context from which the resulting completable is going to be signalled
*/
-public fun Job.toCompletable(context: CoroutineContext): Completable = rxCompletable(context) {
- this@toCompletable.join()
+public fun Job.asCompletable(context: CoroutineContext): Completable = rxCompletable(context) {
+ this@asCompletable.join()
}
/**
@@ -49,8 +49,8 @@
*
* @param context -- the coroutine context from which the resulting single is going to be signalled
*/
-public fun <T> Deferred<T>.toSingle(context: CoroutineContext): Single<T> = rxSingle<T>(context) {
- this@toSingle.await()
+public fun <T> Deferred<T>.asSingle(context: CoroutineContext): Single<T> = rxSingle<T>(context) {
+ this@asSingle.await()
}
/**
@@ -61,7 +61,28 @@
*
* @param context -- the coroutine context from which the resulting observable is going to be signalled
*/
-public fun <T> ReceiveChannel<T>.toObservable(context: CoroutineContext): Observable<T> = rxObservable(context) {
- for (t in this@toObservable)
+public fun <T> ReceiveChannel<T>.asObservable(context: CoroutineContext): Observable<T> = rxObservable(context) {
+ for (t in this@asObservable)
send(t)
}
+
+/**
+ * @suppress **Deprecated**: Renamed to [asCompletable]
+ */
+@Deprecated(message = "Renamed to `asCompletable`",
+ replaceWith = ReplaceWith("asCompletable(context)"))
+public fun Job.toCompletable(context: CoroutineContext): Completable = asCompletable(context)
+
+/**
+ * @suppress **Deprecated**: Renamed to [asSingle]
+ */
+@Deprecated(message = "Renamed to `asSingle`",
+ replaceWith = ReplaceWith("asSingle(context)"))
+public fun <T> Deferred<T>.toSingle(context: CoroutineContext): Single<T> = asSingle(context)
+
+/**
+ * @suppress **Deprecated**: Renamed to [asObservable]
+ */
+@Deprecated(message = "Renamed to `asObservable`",
+ replaceWith = ReplaceWith("asObservable(context)"))
+public fun <T> ReceiveChannel<T>.toObservable(context: CoroutineContext): Observable<T> = asObservable(context)
diff --git a/reactive/kotlinx-coroutines-rx2/src/test/kotlin/kotlinx/coroutines/experimental/rx2/ConvertTest.kt b/reactive/kotlinx-coroutines-rx2/src/test/kotlin/kotlinx/coroutines/experimental/rx2/ConvertTest.kt
index c716a0c..7afe7c1 100644
--- a/reactive/kotlinx-coroutines-rx2/src/test/kotlin/kotlinx/coroutines/experimental/rx2/ConvertTest.kt
+++ b/reactive/kotlinx-coroutines-rx2/src/test/kotlin/kotlinx/coroutines/experimental/rx2/ConvertTest.kt
@@ -30,7 +30,7 @@
val job = launch(context) {
expect(3)
}
- val completable = job.toCompletable(context)
+ val completable = job.asCompletable(context)
completable.subscribe {
expect(4)
}
@@ -46,7 +46,7 @@
expect(3)
throw RuntimeException("OK")
}
- val completable = job.toCompletable(context)
+ val completable = job.asCompletable(context)
completable.subscribe {
expect(4)
}
@@ -61,11 +61,11 @@
delay(50)
"OK"
}
- val single1 = d.toSingle(Unconfined)
+ val single1 = d.asSingle(Unconfined)
checkSingleValue(single1) {
assertEquals("OK", it)
}
- val single2 = d.toSingle(Unconfined)
+ val single2 = d.asSingle(Unconfined)
checkSingleValue(single2) {
assertEquals("OK", it)
}
@@ -77,11 +77,11 @@
delay(50)
throw TestException("OK")
}
- val single1 = d.toSingle(Unconfined)
+ val single1 = d.asSingle(Unconfined)
checkErroneous(single1) {
check(it is TestException && it.message == "OK") { "$it" }
}
- val single2 = d.toSingle(Unconfined)
+ val single2 = d.asSingle(Unconfined)
checkErroneous(single2) {
check(it is TestException && it.message == "OK") { "$it" }
}
@@ -95,7 +95,7 @@
delay(50)
send("K")
}
- val observable = c.toObservable(Unconfined)
+ val observable = c.asObservable(Unconfined)
checkSingleValue(observable.reduce { t1, t2 -> t1 + t2 }.toSingle()) {
assertEquals("OK", it)
}
@@ -109,7 +109,7 @@
delay(50)
throw TestException("K")
}
- val observable = c.toObservable(Unconfined)
+ val observable = c.asObservable(Unconfined)
val single = rxSingle(Unconfined) {
var result = ""
try {