Skip to content

Commit f27750c

Browse files
committed
Promote rx2 extensions to stable, increase deprecation level for obsolete reactive primitives
1 parent 5410890 commit f27750c

File tree

9 files changed

+10
-15
lines changed

9 files changed

+10
-15
lines changed

reactive/kotlinx-coroutines-reactive/src/Channel.kt

+1-2
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,14 @@ import org.reactivestreams.*
2020
* @param request how many items to request from publisher in advance (optional, one by default).
2121
*/
2222
@ObsoleteCoroutinesApi
23-
@Suppress("CONFLICTING_OVERLOADS")
2423
public fun <T> Publisher<T>.openSubscription(request: Int = 1): ReceiveChannel<T> {
2524
val channel = SubscriptionChannel<T>(request)
2625
subscribe(channel)
2726
return channel
2827
}
2928

3029
// Will be promoted to error in 1.3.0, removed in 1.4.0
31-
@Deprecated(message = "Use collect instead", level = DeprecationLevel.WARNING, replaceWith = ReplaceWith("this.collect(action)"))
30+
@Deprecated(message = "Use collect instead", level = DeprecationLevel.ERROR, replaceWith = ReplaceWith("this.collect(action)"))
3231
public suspend inline fun <T> Publisher<T>.consumeEach(action: (T) -> Unit) =
3332
openSubscription().consumeEach(action)
3433

reactive/kotlinx-coroutines-reactor/src/Flux.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ public fun <T> flux(
5050

5151
@Deprecated(
5252
message = "CoroutineScope.flux is deprecated in favour of top-level flux",
53-
level = DeprecationLevel.WARNING,
53+
level = DeprecationLevel.ERROR,
5454
replaceWith = ReplaceWith("flux(context, block)")
5555
) // Since 1.3.0, will be error in 1.3.1 and hidden in 1.4.0. Binary compatibility with Spring
5656
@LowPriorityInOverloadResolution

reactive/kotlinx-coroutines-reactor/src/Mono.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public fun <T> mono(
3939

4040
@Deprecated(
4141
message = "CoroutineScope.mono is deprecated in favour of top-level mono",
42-
level = DeprecationLevel.WARNING,
42+
level = DeprecationLevel.ERROR,
4343
replaceWith = ReplaceWith("mono(context, block)")
4444
) // Since 1.3.0, will be error in 1.3.1 and hidden in 1.4.0
4545
@LowPriorityInOverloadResolution

reactive/kotlinx-coroutines-rx2/src/RxChannel.kt

+2-6
Original file line numberDiff line numberDiff line change
@@ -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")
2322
public 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")
3836
public 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)"))
4644
public 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)"))
5149
public 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
5956
public 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
6763
public suspend inline fun <T> ObservableSource<T>.collect(action: (T) -> Unit) =
6864
openSubscription().consumeEach(action)
6965

reactive/kotlinx-coroutines-rx2/src/RxCompletable.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public fun rxCompletable(
3636

3737
@Deprecated(
3838
message = "CoroutineScope.rxCompletable is deprecated in favour of top-level rxCompletable",
39-
level = DeprecationLevel.WARNING,
39+
level = DeprecationLevel.ERROR,
4040
replaceWith = ReplaceWith("rxCompletable(context, block)")
4141
) // Since 1.3.0, will be error in 1.3.1 and hidden in 1.4.0
4242
@LowPriorityInOverloadResolution

reactive/kotlinx-coroutines-rx2/src/RxFlowable.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public fun <T: Any> rxFlowable(
4545

4646
@Deprecated(
4747
message = "CoroutineScope.rxFlowable is deprecated in favour of top-level rxFlowable",
48-
level = DeprecationLevel.WARNING,
48+
level = DeprecationLevel.ERROR,
4949
replaceWith = ReplaceWith("rxFlowable(context, block)")
5050
) // Since 1.3.0, will be error in 1.3.1 and hidden in 1.4.0
5151
@LowPriorityInOverloadResolution

reactive/kotlinx-coroutines-rx2/src/RxMaybe.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public fun <T> rxMaybe(
3737

3838
@Deprecated(
3939
message = "CoroutineScope.rxMaybe is deprecated in favour of top-level rxMaybe",
40-
level = DeprecationLevel.WARNING,
40+
level = DeprecationLevel.ERROR,
4141
replaceWith = ReplaceWith("rxMaybe(context, block)")
4242
) // Since 1.3.0, will be error in 1.3.1 and hidden in 1.4.0
4343
@LowPriorityInOverloadResolution

reactive/kotlinx-coroutines-rx2/src/RxObservable.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public fun <T : Any> rxObservable(
4646

4747
@Deprecated(
4848
message = "CoroutineScope.rxObservable is deprecated in favour of top-level rxObservable",
49-
level = DeprecationLevel.WARNING,
49+
level = DeprecationLevel.ERROR,
5050
replaceWith = ReplaceWith("rxObservable(context, block)")
5151
) // Since 1.3.0, will be error in 1.3.1 and hidden in 1.4.0
5252
@LowPriorityInOverloadResolution

reactive/kotlinx-coroutines-rx2/src/RxSingle.kt

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public fun <T : Any> rxSingle(
3636

3737
@Deprecated(
3838
message = "CoroutineScope.rxSingle is deprecated in favour of top-level rxSingle",
39-
level = DeprecationLevel.WARNING,
39+
level = DeprecationLevel.ERROR,
4040
replaceWith = ReplaceWith("rxSingle(context, block)")
4141
) // Since 1.3.0, will be error in 1.3.1 and hidden in 1.4.0
4242
@LowPriorityInOverloadResolution

0 commit comments

Comments
 (0)