Following Coroutines support introduced in Spring WebFlux and since Spring MVC supports Mono
via the ReactiveAdapterRegistry
, it would probably makes sense to support Coroutines (suspending handler methods) in Spring MVC.
It will require similar handling than in WebFlux side + disabling the check introduced via #23585.
Good candidate for Spring Framework 5.3.
Comment From: achatellier
Hello Sebastien, I have seen your conference at Bordeaux this week (thanks for that, I learned a lot) and I was trying to use suspending handler methods.
Is there a way to test it today with a Spring beta version (I can't find one) or do I have to wait for the 5.3 release to use this feature ?
I've made a test with Spring 5.2 and obviously it doesn't work. (Sorry if it's not the right place to ask this question)
Comment From: sdeleuze
Hi, such support is not yet available in snapshots so you have to wait or contribute a PR ;-)
Comment From: sgarfinkel
@sdeleuze Is this still unimplemented? This article clearly implies that WebMVC supports suspendible functions: https://spring.io/blog/2019/04/12/going-reactive-with-spring-coroutines-and-kotlin-flow
I think this limitation should be more clearly documented.
Comment From: sdeleuze
@sgarfinkel I don't think this article I have written imply that. Coroutines section specifies are supported only in WebFlux for now.