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

Revisit Reactive context hierarchy #16411

Open
snicoll opened this issue Apr 2, 2019 · 0 comments
Open

Revisit Reactive context hierarchy #16411

snicoll opened this issue Apr 2, 2019 · 0 comments
Assignees
Labels
type: enhancement A general enhancement

Comments

@snicoll
Copy link
Member

snicoll commented Apr 2, 2019

The context hierarchy for reactive support contains a number of classes that do not seem very useful:

  • ConfigurableReactiveWebApplicationContext seems to be a marker interface
  • StandardReactiveWebEnvironment is just a StandardEnvironment that implements the empty ConfigurableReactiveWebEnvironment marker interface

There are two distincts reasons for this hierarchy

ConfigurableReactiveWebApplicationContext seems to be only used by ReactiveWebApplicationContextRunner. The bottom line is that the supplier must provide a ConfigurableReactiveWebApplicationContext but what the infrastructure really requires behind the scene is a ConfigurableApplicationContext that can be identified by the conditions as being reactive. Such type does not give you that guarantee as you may have a context that implements ConfigurableReactiveWebApplicationContext but returns an Environment that is not a ConfigurableReactiveWebEnvironment. Perhaps we could remove this in benefit of a check of the environment as that's what our condition is mostly using.

As for the environment itself, a SpringBootEnvironment that is a StandardEnvironment and has a WebApplicationType accessor would be enough for most use cases except the servlet one. Rather than creating a complete hierarchy for that, maybe we should simply create such dedicated environment and check for its presence in the conditions?

@snicoll snicoll added the for: team-attention An issue we'd like other members of the team to review label Apr 2, 2019
@philwebb philwebb added status: pending-design-work Needs design work before any code can be developed and removed for: team-attention An issue we'd like other members of the team to review labels Apr 3, 2019
@philwebb philwebb added type: enhancement A general enhancement and removed status: pending-design-work Needs design work before any code can be developed labels Nov 15, 2019
@philwebb philwebb added this to the General Backlog milestone Nov 15, 2019
@snicoll snicoll removed their assignment Nov 21, 2022
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