【发布时间】:2021-06-22 20:23:29
【问题描述】:
当我们使用 Spring WebFlux 的 RSocket(通过 WebSockets)支持使用 Kotlin Coroutines Flow 和 Reactor Flux 发出值时,IO 流量有什么不同吗?
@MessageMapping("stream")
suspend fun send(): kotlinx.coroutines.flow.Flow<SomeClass> = ...
VS
@MessageMapping("stream")
fun send(): reactor.core.publisher.Flux<SomeClass> = ...
另外,客户端代码(带有rsocket-websocket-client的JS)是否应该根据服务器使用Kotlin Coroutines Flow还是Reactor Flux而有所不同?
【问题讨论】:
标签: spring-webflux kotlin-coroutines project-reactor rsocket