I'm using spring webflux `WebFilter` with kotlin c...
# spring
t
I'm using spring webflux
WebFilter
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?
d
Copy code
override fun filter(exchange: ServerWebExchange, chain: WebFilterChain): Mono<Void> = mono {
   // call your function here
}
t
but
chain.filter(exchange)
is returning a
Mono
already
d
You can await on it
t
That's what I'm concerned because I can use
Mono.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()
343 Views