File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
reactive/kotlinx-coroutines-reactor Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ public final class kotlinx/coroutines/reactor/ReactorContext : kotlin/coroutines
3535 public fun <init> (Lreactor/util/context/Context;)V
3636 public fun <init> (Lreactor/util/context/ContextView;)V
3737 public final fun getContext ()Lreactor/util/context/Context;
38+ public fun toString ()Ljava/lang/String;
3839}
3940
4041public final class kotlinx/coroutines/reactor/ReactorContext$Key : kotlin/coroutines/CoroutineContext$Key {
Original file line number Diff line number Diff line change @@ -27,18 +27,18 @@ import reactor.util.context.*
2727 * ```
2828 * val flux = myDatabaseService.getUsers()
2929 * .contextWrite { ctx -> println(ctx); ctx }
30- * flux.await () // Will print "null"
30+ * flux.awaitFirst () // Will print "null"
3131 *
3232 * // Now add ReactorContext
3333 * withContext(Context.of("answer", "42").asCoroutineContext()) {
34- * flux.await () // Will print "Context{'key'='value'}"
34+ * flux.awaitFirst () // Will print "Context{'key'='value'}"
3535 * }
3636 * ```
3737 *
3838 * #### Propagating subscriber's Context to ReactorContext:
3939 * ```
4040 * val flow = flow {
41- * println("Reactor context in Flow: " + coroutineContext [ReactorContext])
41+ * println("Reactor context in Flow: " + currentCoroutineContext() [ReactorContext])
4242 * }
4343 * // No context
4444 * flow.asFlux()
@@ -55,6 +55,8 @@ public class ReactorContext(public val context: Context) : AbstractCoroutineCont
5555 public constructor (contextView: ContextView ): this (Context .of(contextView))
5656
5757 public companion object Key : CoroutineContext.Key<ReactorContext>
58+
59+ override fun toString (): String = context.toString()
5860}
5961
6062/* *
You can’t perform that action at this time.
0 commit comments