Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make ReactorContext accept ContextView #2575

Closed
capnrotbart opened this issue Mar 9, 2021 · 0 comments
Closed

Make ReactorContext accept ContextView #2575

capnrotbart opened this issue Mar 9, 2021 · 0 comments
Assignees
Labels

Comments

@capnrotbart
Copy link

Reactor 3.5.0 appears to be phasing out Context as the public facing type in favor of ContextView. I think ReactorContext should probably accept a ContextView instead of a Context.

Before:

Mono.deferWithContext { ctx ->
    mono(context = ReactorContext(ctx)) {
        // do something
    }
}.subscribe()

This isn't a huge stumbling block, as Context provides the of constructor.

Mono.deferContextual { ctx ->
    mono(context = ReactorContext(Context.of(ctx))) { // Works just fine, is a Context most likely anyway
        // do something
    }
}.subscribe()

But still, this seems more appropriate and may reduce confusion.

Mono.deferContextual { ctx ->
    mono(context = ReactorContext(ctx)) { // Won't compile
        // do something
    }
}.subscribe()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants