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.
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:
subscription will cause an
InMemoryWebSessionto be constructed. Since this is a blocking operation, it would be nice to avoid it when not needed.If instead an application could do:
then the predicate would not be invoked at all and construction of
InMemoryWebSessionwould be avoided.