You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are cases where the default CoroutineContext has to be modified for all suspendable RestEasy Resource method calls, for example in order to add a custom CoroutineContext.Element for every request, that would hold application-specific details, such as tenant ID (which is precisely my case btw).
This can be done manually, but it's tedious and error-prone.
It would be nice to introduce a mechanism that would make it possible to modify the default CoroutineContext.
It can be either of a form CoroutineWebFilter, that would return a suspendable function and would respect the context in the downstream, e.g.:
Spring Webflux approach for the issue (which will be released in 6.1) - current implementation of CoWebFilter does not respect the CoroutineContext changes:
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
There are cases where the default
CoroutineContext
has to be modified for all suspendable RestEasy Resource method calls, for example in order to add a customCoroutineContext.Element
for every request, that would hold application-specific details, such as tenant ID (which is precisely my case btw).This can be done manually, but it's tedious and error-prone.
It would be nice to introduce a mechanism that would make it possible to modify the default CoroutineContext.
It can be either of a form CoroutineWebFilter, that would return a suspendable function and would respect the context in the downstream, e.g.:
Or similarly to the Spring approach (links below) - registering a list of
CoroutineContext.Element
in a filter (per request)After:
Spring Webflux approach for the issue (which will be released in 6.1) - current implementation of CoWebFilter does not respect the
CoroutineContext
changes:CoroutineContext
inCoWebFilter
spring-projects/spring-framework#27522Beta Was this translation helpful? Give feedback.
All reactions