Update to Coroutine 1.3.0-RC2

This updates brings full interoperability between Reactor and
Coroutines contexts.

Closes gh-22986
This commit is contained in:
Sebastien Deleuze
2019-08-14 11:07:11 +02:00
parent 19ed439e4b
commit 4d10249b70
7 changed files with 11 additions and 14 deletions

View File

@@ -24,7 +24,7 @@ import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.async
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.reactive.awaitFirstOrNull
import kotlinx.coroutines.reactive.flow.asPublisher
import kotlinx.coroutines.reactor.asFlux
import kotlinx.coroutines.reactor.mono
import reactor.core.publisher.Mono
@@ -68,7 +68,7 @@ internal fun invokeHandlerMethod(method: Method, bean: Any, vararg args: Any?):
.let { if (it == Unit) null else it }
}.onErrorMap(InvocationTargetException::class.java) { it.targetException }
if (function.returnType.classifier == Flow::class) {
mono.flatMapMany { (it as Flow<Any>).asPublisher() }
mono.flatMapMany { (it as Flow<Any>).asFlux() }
}
else {
mono