Skip to content

Commit 47a063c

Browse files
authored
Remove the @ExperimentalCoroutinesApi annotation from reactive integrations (#2670)
1 parent 3116b8c commit 47a063c

File tree

11 files changed

+0
-24
lines changed

11 files changed

+0
-24
lines changed

reactive/kotlinx-coroutines-jdk9/src/Publish.kt

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import org.reactivestreams.FlowAdapters
3232
*
3333
* @throws IllegalArgumentException if the provided [context] contains a [Job] instance.
3434
*/
35-
@ExperimentalCoroutinesApi
3635
public fun <T> flowPublish(
3736
context: CoroutineContext = EmptyCoroutineContext,
3837
@BuilderInference block: suspend ProducerScope<T>.() -> Unit

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

-1
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import kotlin.coroutines.*
3232
*
3333
* @throws IllegalArgumentException if the provided [context] contains a [Job] instance.
3434
*/
35-
@ExperimentalCoroutinesApi
3635
public fun <T> publish(
3736
context: CoroutineContext = EmptyCoroutineContext,
3837
@BuilderInference block: suspend ProducerScope<T>.() -> Unit

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

-2
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import kotlin.coroutines.*
2121
*
2222
* @param context -- the coroutine context from which the resulting mono is going to be signalled
2323
*/
24-
@ExperimentalCoroutinesApi
2524
public fun Job.asMono(context: CoroutineContext): Mono<Unit> = mono(context) { this@asMono.join() }
2625
/**
2726
* Converts this deferred value to the hot reactive mono that signals
@@ -35,7 +34,6 @@ public fun Job.asMono(context: CoroutineContext): Mono<Unit> = mono(context) { t
3534
*
3635
* @param context -- the coroutine context from which the resulting mono is going to be signalled
3736
*/
38-
@ExperimentalCoroutinesApi
3937
public fun <T> Deferred<T?>.asMono(context: CoroutineContext): Mono<T> = mono(context) { this@asMono.await() }
4038

4139
/**

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

-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ import kotlin.coroutines.*
2929
*
3030
* @throws IllegalArgumentException if the provided [context] contains a [Job] instance.
3131
*/
32-
@ExperimentalCoroutinesApi
3332
public fun <T> flux(
3433
context: CoroutineContext = EmptyCoroutineContext,
3534
@BuilderInference block: suspend ProducerScope<T>.() -> Unit

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

-3
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@ import reactor.util.context.*
4949
* .subscribe() // Will print "Reactor context in Flow: Context{'answer'=42}"
5050
* ```
5151
*/
52-
@ExperimentalCoroutinesApi
5352
public class ReactorContext(public val context: Context) : AbstractCoroutineContextElement(ReactorContext) {
5453

5554
// `Context.of` is zero-cost if the argument is a `Context`
@@ -62,14 +61,12 @@ public class ReactorContext(public val context: Context) : AbstractCoroutineCont
6261
* Wraps the given [ContextView] into [ReactorContext], so it can be added to the coroutine's context
6362
* and later used via `coroutineContext[ReactorContext]`.
6463
*/
65-
@ExperimentalCoroutinesApi
6664
public fun ContextView.asCoroutineContext(): ReactorContext = ReactorContext(this)
6765

6866
/**
6967
* Wraps the given [Context] into [ReactorContext], so it can be added to the coroutine's context
7068
* and later used via `coroutineContext[ReactorContext]`.
7169
*/
72-
@ExperimentalCoroutinesApi
7370
@Deprecated("The more general version for ContextView should be used instead", level = DeprecationLevel.HIDDEN)
7471
public fun Context.asCoroutineContext(): ReactorContext = readOnly().asCoroutineContext() // `readOnly()` is zero-cost.
7572

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

-6
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import kotlin.coroutines.*
2626
*
2727
* @param context -- the coroutine context from which the resulting completable is going to be signalled
2828
*/
29-
@ExperimentalCoroutinesApi
3029
public fun Job.asCompletable(context: CoroutineContext): Completable = rxCompletable(context) {
3130
this@asCompletable.join()
3231
}
@@ -43,7 +42,6 @@ public fun Job.asCompletable(context: CoroutineContext): Completable = rxComplet
4342
*
4443
* @param context -- the coroutine context from which the resulting maybe is going to be signalled
4544
*/
46-
@ExperimentalCoroutinesApi
4745
public fun <T> Deferred<T?>.asMaybe(context: CoroutineContext): Maybe<T> = rxMaybe(context) {
4846
this@asMaybe.await()
4947
}
@@ -60,7 +58,6 @@ public fun <T> Deferred<T?>.asMaybe(context: CoroutineContext): Maybe<T> = rxMay
6058
*
6159
* @param context -- the coroutine context from which the resulting single is going to be signalled
6260
*/
63-
@ExperimentalCoroutinesApi
6461
public fun <T : Any> Deferred<T>.asSingle(context: CoroutineContext): Single<T> = rxSingle(context) {
6562
this@asSingle.await()
6663
}
@@ -75,7 +72,6 @@ public fun <T : Any> Deferred<T>.asSingle(context: CoroutineContext): Single<T>
7572
* resulting flow to specify a user-defined value and to control what happens when data is produced faster
7673
* than consumed, i.e. to control the back-pressure behavior. Check [callbackFlow] for more details.
7774
*/
78-
@ExperimentalCoroutinesApi
7975
public fun <T: Any> ObservableSource<T>.asFlow(): Flow<T> = callbackFlow {
8076
val disposableRef = AtomicReference<Disposable>()
8177
val observer = object : Observer<T> {
@@ -108,7 +104,6 @@ public fun <T: Any> ObservableSource<T>.asFlow(): Flow<T> = callbackFlow {
108104
* inject additional context into the caller thread. By default, the [Unconfined][Dispatchers.Unconfined] dispatcher
109105
* is used, so calls are performed from an arbitrary thread.
110106
*/
111-
@ExperimentalCoroutinesApi
112107
public fun <T: Any> Flow<T>.asObservable(context: CoroutineContext = EmptyCoroutineContext) : Observable<T> = Observable.create { emitter ->
113108
/*
114109
* ATOMIC is used here to provide stable behaviour of subscribe+dispose pair even if
@@ -141,7 +136,6 @@ public fun <T: Any> Flow<T>.asObservable(context: CoroutineContext = EmptyCorout
141136
* inject additional context into the caller thread. By default, the [Unconfined][Dispatchers.Unconfined] dispatcher
142137
* is used, so calls are performed from an arbitrary thread.
143138
*/
144-
@ExperimentalCoroutinesApi
145139
public fun <T: Any> Flow<T>.asFlowable(context: CoroutineContext = EmptyCoroutineContext): Flowable<T> =
146140
Flowable.fromPublisher(asPublisher(context))
147141

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

-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@ import kotlin.internal.*
3131
*
3232
* **Note: This is an experimental api.** Behaviour of publishers that work as children in a parent scope with respect
3333
*/
34-
@ExperimentalCoroutinesApi
3534
public fun <T: Any> rxFlowable(
3635
context: CoroutineContext = EmptyCoroutineContext,
3736
@BuilderInference block: suspend ProducerScope<T>.() -> Unit

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

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import kotlin.coroutines.*
3030
* If the context does not have any dispatcher nor any other [ContinuationInterceptor], then [Dispatchers.Default] is used.
3131
* Method throws [IllegalArgumentException] if provided [context] contains a [Job] instance.
3232
*/
33-
@ExperimentalCoroutinesApi
3433
public fun <T : Any> rxObservable(
3534
context: CoroutineContext = EmptyCoroutineContext,
3635
@BuilderInference block: suspend ProducerScope<T>.() -> Unit

reactive/kotlinx-coroutines-rx3/src/RxConvert.kt

-6
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ import kotlin.coroutines.*
2626
*
2727
* @param context -- the coroutine context from which the resulting completable is going to be signalled
2828
*/
29-
@ExperimentalCoroutinesApi
3029
public fun Job.asCompletable(context: CoroutineContext): Completable = rxCompletable(context) {
3130
this@asCompletable.join()
3231
}
@@ -43,7 +42,6 @@ public fun Job.asCompletable(context: CoroutineContext): Completable = rxComplet
4342
*
4443
* @param context -- the coroutine context from which the resulting maybe is going to be signalled
4544
*/
46-
@ExperimentalCoroutinesApi
4745
public fun <T> Deferred<T?>.asMaybe(context: CoroutineContext): Maybe<T> = rxMaybe(context) {
4846
this@asMaybe.await()
4947
}
@@ -60,7 +58,6 @@ public fun <T> Deferred<T?>.asMaybe(context: CoroutineContext): Maybe<T> = rxMay
6058
*
6159
* @param context -- the coroutine context from which the resulting single is going to be signalled
6260
*/
63-
@ExperimentalCoroutinesApi
6461
public fun <T : Any> Deferred<T>.asSingle(context: CoroutineContext): Single<T> = rxSingle(context) {
6562
this@asSingle.await()
6663
}
@@ -75,7 +72,6 @@ public fun <T : Any> Deferred<T>.asSingle(context: CoroutineContext): Single<T>
7572
* resulting flow to specify a user-defined value and to control what happens when data is produced faster
7673
* than consumed, i.e. to control the back-pressure behavior. Check [callbackFlow] for more details.
7774
*/
78-
@ExperimentalCoroutinesApi
7975
public fun <T: Any> ObservableSource<T>.asFlow(): Flow<T> = callbackFlow {
8076
val disposableRef = AtomicReference<Disposable>()
8177
val observer = object : Observer<T> {
@@ -108,7 +104,6 @@ public fun <T: Any> ObservableSource<T>.asFlow(): Flow<T> = callbackFlow {
108104
* inject additional context into the caller thread. By default, the [Unconfined][Dispatchers.Unconfined] dispatcher
109105
* is used, so calls are performed from an arbitrary thread.
110106
*/
111-
@ExperimentalCoroutinesApi
112107
public fun <T: Any> Flow<T>.asObservable(context: CoroutineContext = EmptyCoroutineContext) : Observable<T> = Observable.create { emitter ->
113108
/*
114109
* ATOMIC is used here to provide stable behaviour of subscribe+dispose pair even if
@@ -141,7 +136,6 @@ public fun <T: Any> Flow<T>.asObservable(context: CoroutineContext = EmptyCorout
141136
* inject additional context into the caller thread. By default, the [Unconfined][Dispatchers.Unconfined] dispatcher
142137
* is used, so calls are performed from an arbitrary thread.
143138
*/
144-
@ExperimentalCoroutinesApi
145139
public fun <T: Any> Flow<T>.asFlowable(context: CoroutineContext = EmptyCoroutineContext): Flowable<T> =
146140
Flowable.fromPublisher(asPublisher(context))
147141

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

-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ import kotlin.coroutines.*
2828
*
2929
* **Note: This is an experimental api.** Behaviour of publishers that work as children in a parent scope with respect
3030
*/
31-
@ExperimentalCoroutinesApi
3231
public fun <T: Any> rxFlowable(
3332
context: CoroutineContext = EmptyCoroutineContext,
3433
@BuilderInference block: suspend ProducerScope<T>.() -> Unit

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

-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ import kotlinx.coroutines.internal.*
3030
* If the context does not have any dispatcher nor any other [ContinuationInterceptor], then [Dispatchers.Default] is used.
3131
* Method throws [IllegalArgumentException] if provided [context] contains a [Job] instance.
3232
*/
33-
@ExperimentalCoroutinesApi
3433
public fun <T : Any> rxObservable(
3534
context: CoroutineContext = EmptyCoroutineContext,
3635
@BuilderInference block: suspend ProducerScope<T>.() -> Unit

0 commit comments

Comments
 (0)