Skip to content

Switch back to parallel thread after WebSession id is generated #26958

Closed
@jzheaux

Description

@jzheaux

It would be nice if there were a way to request the session without creating an instance of one, similar conceptually to HttpServletRequest#getSession(false).

Whenever the session is requested, say like so:

exchange.getSession().filter((session) -> {
    if (session.getAttribute("attribute") != null) {
        // ...
    }
})
// ...

subscription will cause an InMemoryWebSession to be constructed. Since this is a blocking operation, it would be nice to avoid it when not needed.

If instead an application could do:

exchange.getSessionOrEmpty().filter((session) -> {
    if (session.getAttribute("attribute") != null) {
        // ...
    }
})

then the predicate would not be invoked at all and construction of InMemoryWebSession would be avoided.

Metadata

Metadata

Assignees

Labels

in: webIssues in web modules (web, webmvc, webflux, websocket)type: enhancementA general enhancement

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions