tvtan
12/18/2020, 3:20 AMWebFilter
with kotlin coroutines, currently the only way I can run suspend function
in filter
function is using runBlocking
. Is there a better way for calling a suspend function in that case?Dariusz Kuc
12/18/2020, 3:33 AMoverride fun filter(exchange: ServerWebExchange, chain: WebFilterChain): Mono<Void> = mono {
// call your function here
}
tvtan
12/18/2020, 4:22 AMchain.filter(exchange)
is returning a Mono
alreadyDariusz Kuc
12/18/2020, 6:53 AMtvtan
12/18/2020, 8:55 AMMono.awaitSingle()
but I'm not sure it will have the same behavior with returning the Mono from chain.filter(exchange)
, especially I'm writing a context by using chain.filter(exchange).contextWrite().awaitSingle()