【发布时间】:2020-03-02 09:16:56
【问题描述】:
我可以通过以下方式轻松链接coroutineFlows:
val someFlow = flow { //Some logic that my succeed or throw error }
val anotherFlow = flow { // Another logic that my succeed or throe error }
val resultingFlow = someFlow.flatmapLatest(anotherFlow)
但是如果我想单独重试someFlow 和anotherFlow 如果someFlow 已经成功返回一个值但anotherFlow 失败,我想通过使用来自的值重试anotherFlow someFlow(成功时返回的值)。
最好的方法是什么?
【问题讨论】:
标签: kotlin-coroutines kotlin-flow