If I have code like so:
data class Response(
val a: String,
val b: List<String>,
val c: Int,
)
fun buildResponse(): Response {
val a: Mono<String> = getA()
val b: Flux<String> = getB()
val c: Mono<Int> = getC()
return Response(
a = a.blockOptional().orElseThrow(),
b = b.collectList().blockOptional().orElseThrow(),
c = c.blockOptional().orElseThrow(),
)
}
Is there a way to reactively return a Mono<Response> instead of blocking and returning the actual Response?