Skip to content

Commit 67f7971

Browse files
committed
Cleanup
1 parent 2fa8ee9 commit 67f7971

File tree

3 files changed

+8
-14
lines changed

3 files changed

+8
-14
lines changed

binary-compatibility-validator/reference-public-api/kotlinx-coroutines-reactor.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public final class kotlinx/coroutines/reactor/ReactorContext$Key : kotlin/corout
2929
}
3030

3131
public final class kotlinx/coroutines/reactor/ReactorContextKt {
32-
public static final fun asCoroutineContext (Lreactor/util/context/Context;)Lkotlin/coroutines/CoroutineContext;
32+
public static final fun asCoroutineContext (Lreactor/util/context/Context;)Lkotlinx/coroutines/reactor/ReactorContext;
3333
}
3434

3535
public final class kotlinx/coroutines/reactor/SchedulerCoroutineDispatcher : kotlinx/coroutines/CoroutineDispatcher, kotlinx/coroutines/Delay {

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -74,4 +74,4 @@ private fun <T> reactorPublish(
7474
val coroutine = PublisherCoroutine(newContext, subscriber)
7575
subscriber.onSubscribe(coroutine) // do it first (before starting coroutine), to avoid unnecessary suspensions
7676
coroutine.start(CoroutineStart.DEFAULT, coroutine, block)
77-
}
77+
}

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

+6-12
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,14 @@ import reactor.util.context.Context
55
import kotlin.coroutines.*
66

77
/**
8-
* Marks coroutine context element that contains Reactor's [Context] elements in [context] for seamless integration
9-
* between [CoroutineContext] and Reactor's [Context].
8+
* Wraps Reactor's [Context] into [CoroutineContext] element for seamless integration Reactor and kotlinx.coroutines.
109
*
1110
* [Context.asCoroutineContext] is defined to add Reactor's [Context] elements as part of [CoroutineContext].
1211
*
13-
* Reactor builders: [mono], [flux] can extract the reactor context from their coroutine context and
14-
* pass it on. Modifications of reactor context can be retrieved by `coroutineContext[ReactorContext]`.
15-
*
16-
* Example usage:
12+
* Reactor builders [mono] and [flux] use this context element to enhance the resulting `subscriberContext`.
1713
*
14+
* ### Usages
1815
* Passing reactor context from coroutine builder to reactor entity:
19-
*
2016
* ```
2117
* launch(Context.of("key", "value").asCoroutineContext()) {
2218
* mono {
@@ -25,8 +21,7 @@ import kotlin.coroutines.*
2521
* }
2622
* ```
2723
*
28-
* Accessing modified reactor context enriched from downstream via coroutine context:
29-
*
24+
* Accessing modified reactor context enriched from the downstream:
3025
* ```
3126
* launch {
3227
* mono {
@@ -41,10 +36,9 @@ public class ReactorContext(val context: Context) : AbstractCoroutineContextElem
4136
companion object Key : CoroutineContext.Key<ReactorContext>
4237
}
4338

44-
4539
/**
4640
* Wraps the given [Context] into [ReactorContext], so it can be added to coroutine's context
47-
* and later retrieved via `coroutineContext[ReactorContext]`.
41+
* and later used via `coroutineContext[ReactorContext]`.
4842
*/
4943
@ExperimentalCoroutinesApi
50-
public fun Context.asCoroutineContext(): CoroutineContext = ReactorContext(this)
44+
public fun Context.asCoroutineContext(): ReactorContext = ReactorContext(this)

0 commit comments

Comments
 (0)