File tree 2 files changed +6
-3
lines changed
reactive/kotlinx-coroutines-reactor
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
35
35
public fun <init> (Lreactor/util/context/Context;)V
36
36
public fun <init> (Lreactor/util/context/ContextView;)V
37
37
public final fun getContext ()Lreactor/util/context/Context;
38
+ public fun toString ()Ljava/lang/String;
38
39
}
39
40
40
41
public 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.*
27
27
* ```
28
28
* val flux = myDatabaseService.getUsers()
29
29
* .contextWrite { ctx -> println(ctx); ctx }
30
- * flux.await () // Will print "null"
30
+ * flux.awaitFirst () // Will print "null"
31
31
*
32
32
* // Now add ReactorContext
33
33
* withContext(Context.of("answer", "42").asCoroutineContext()) {
34
- * flux.await () // Will print "Context{'key'='value'}"
34
+ * flux.awaitFirst () // Will print "Context{'key'='value'}"
35
35
* }
36
36
* ```
37
37
*
38
38
* #### Propagating subscriber's Context to ReactorContext:
39
39
* ```
40
40
* val flow = flow {
41
- * println("Reactor context in Flow: " + coroutineContext [ReactorContext])
41
+ * println("Reactor context in Flow: " + currentCoroutineContext() [ReactorContext])
42
42
* }
43
43
* // No context
44
44
* flow.asFlux()
@@ -55,6 +55,8 @@ public class ReactorContext(public val context: Context) : AbstractCoroutineCont
55
55
public constructor (contextView: ContextView ): this (Context .of(contextView))
56
56
57
57
public companion object Key : CoroutineContext.Key<ReactorContext>
58
+
59
+ override fun toString (): String = context.toString()
58
60
}
59
61
60
62
/* *
You can’t perform that action at this time.
0 commit comments