@@ -19,7 +19,6 @@ import kotlinx.coroutines.internal.*
1919 * See [issue #254](https://github.com/Kotlin/kotlinx.coroutines/issues/254).
2020 */
2121@ObsoleteCoroutinesApi
22- @Suppress(" CONFLICTING_OVERLOADS" )
2322public fun <T > MaybeSource<T>.openSubscription (): ReceiveChannel <T > {
2423 val channel = SubscriptionChannel <T >()
2524 subscribe(channel)
@@ -34,36 +33,33 @@ public fun <T> MaybeSource<T>.openSubscription(): ReceiveChannel<T> {
3433 * See [issue #254](https://github.com/Kotlin/kotlinx.coroutines/issues/254).
3534 */
3635@ObsoleteCoroutinesApi
37- @Suppress(" CONFLICTING_OVERLOADS" )
3836public fun <T > ObservableSource<T>.openSubscription (): ReceiveChannel <T > {
3937 val channel = SubscriptionChannel <T >()
4038 subscribe(channel)
4139 return channel
4240}
4341
4442// Will be promoted to error in 1.3.0, removed in 1.4.0
45- @Deprecated(message = " Use collect instead" , level = DeprecationLevel .WARNING , replaceWith = ReplaceWith (" this.collect(action)" ))
43+ @Deprecated(message = " Use collect instead" , level = DeprecationLevel .ERROR , replaceWith = ReplaceWith (" this.collect(action)" ))
4644public suspend inline fun <T > MaybeSource<T>.consumeEach (action : (T ) -> Unit ) =
4745 openSubscription().consumeEach(action)
4846
4947// Will be promoted to error in 1.3.0, removed in 1.4.0
50- @Deprecated(message = " Use collect instead" , level = DeprecationLevel .WARNING , replaceWith = ReplaceWith (" this.collect(action)" ))
48+ @Deprecated(message = " Use collect instead" , level = DeprecationLevel .ERROR , replaceWith = ReplaceWith (" this.collect(action)" ))
5149public suspend inline fun <T > ObservableSource<T>.consumeEach (action : (T ) -> Unit ) =
5250 openSubscription().consumeEach(action)
5351
5452/* *
5553 * Subscribes to this [MaybeSource] and performs the specified action for each received element.
5654 * Cancels subscription if any exception happens during collect.
5755 */
58- @ExperimentalCoroutinesApi // Since 1.2.1, tentatively till 1.3.0
5956public suspend inline fun <T > MaybeSource<T>.collect (action : (T ) -> Unit ) =
6057 openSubscription().consumeEach(action)
6158
6259/* *
6360 * Subscribes to this [ObservableSource] and performs the specified action for each received element.
6461 * Cancels subscription if any exception happens during collect.
6562 */
66- @ExperimentalCoroutinesApi // Since 1.2.1, tentatively till 1.3.0
6763public suspend inline fun <T > ObservableSource<T>.collect (action : (T ) -> Unit ) =
6864 openSubscription().consumeEach(action)
6965
0 commit comments