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

Operators that work with Context should not allow replacing it #2056

Closed
bsideup opened this issue Feb 26, 2020 · 0 comments
Closed

Operators that work with Context should not allow replacing it #2056

bsideup opened this issue Feb 26, 2020 · 0 comments
Labels
type/enhancement A general enhancement
Milestone

Comments

@bsideup
Copy link
Contributor

bsideup commented Feb 26, 2020

Motivation

Currently, there are operators like retryWhen that allow replacing the Context in the user's code. It is error prone and does not seem to have valid use cases (to be validated)

Desired solution

Instead of replacing, user-provided Context should always be merged into the current one.
Currently, only retryWhen is considered, but we should check whether there are other operators that allow user-provided functions replace the Context.

Considered alternatives

TBD

Additional context

https://projectreactor.io/docs/core/release/api/reactor/core/publisher/Flux.html#retryWhen-java.util.function.Function-

Note that if the companion Publisher created by the whenFactory emits Context as trigger objects, these Context will REPLACE the operator's own Context. Please be careful there: replacing the Context means that some keys you don't own could be removed, breaking libraries that depend on them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants