question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Introduce interop between CoroutineContext and Reactor Context

See original GitHub issue

Reactor Context seems similar to CoroutineContext, so I tend to think it should be interesting to upgrade kotlinx-coroutines-reactor for seamless integration between both.

@elizarov Any thoughts?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:6
  • Comments:15 (10 by maintainers)

github_iconTop GitHub Comments

7reactions
elizarovcommented, Mar 13, 2018

@sdeleuze It makes total sense. They seem to fit conceptually. We can have Context.asCoroutineContext extension, so that you can mix it into the coroutine context, implement ReactorContext: CoroutineContext.Key, so that you can retrieve it back via coroutineContext[ReactorContext], and we can have all the reactor builders automatically extract the rector context from their coroutine context and pass it on. I’m open to PR.

0reactions
eiswindcommented, Aug 5, 2019

Thx for the reply.

.subscriberContext { c -> c.putAll(ReactiveSecurityContextHolder.withAuthentication(UsernamePasswordAuthenticationToken("", ""))) }

seems to be just the wrong way.

.subscriberContext { c -> c.put(SecurityContext::class.java, Mono.just(SecurityContextImpl(UsernamePasswordAuthenticationToken("", "")))) }

did the trick. Again thanks for the support.

Read more comments on GitHub >

github_iconTop Results From Across the Web

ReactorContext - Kotlin
Wraps Reactor's Context into a CoroutineContext element for seamless integration between Reactor and kotlinx.coroutines. Context.
Read more >
Going Reactive with Spring, Coroutines and Kotlin Flow
As I said in the introduction, choices depend of the context and are a matter of taste. I am a big fan of...
Read more >
Async Models | GraphQL Kotlin
In order to preserve coroutine context, we need to populate GraphQLContext map with a CoroutineScope that should be used to execute any suspendable...
Read more >
Kotlin Coroutines 1.5: GlobalScope Marked as Delicate ...
In top-level code, when launching a concurrent operation from a non-suspending context, an appropriately confined instance of CoroutineScope ...
Read more >
How to call a reactor function from a coroutine context?
At first glance, we do not see bridging methods in kotlinx-coroutines-reactor to await from a Flux . But:.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found