Robert Jaros
10/08/2019, 11:06 AM@Controller
open class MyController {
@RequestMapping("/**")
fun mapping(req: HttpServletRequest, res: HttpServletResponse) {
// write to res.outputStream
}
}
I'm trying to do similar thing with Spring WebFlux:
@Controller
open class MyController {
@RequestMapping("/**")
suspend fun mapping(req: ServerHttpRequest, res: ServerHttpResponse) {
// write with res.writeAndFlushWith { }
}
}
Will it work? Can the mapping function have suspend modifier?