Join Slack
Powered by
Hi, how can I resume the Flow after catching a exc...
# flow
l
Lance Gao
05/31/2023, 10:01 AM
Hi, how can I resume the Flow after catching a exception like onErrorResumeNext in RxJava?
e
elizarov
05/31/2023, 3:24 PM
You cannot resume failed flow.
elizarov
05/31/2023, 3:24 PM
Why would you need that ?
f
Francesc
05/31/2023, 3:34 PM
you can use
retry
,
https://kotlinlang.org/api/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/retry.html
Francesc
05/31/2023, 3:35 PM
note that this does not resume, it restarts
l
Lance Gao
06/01/2023, 2:11 AM
Hi
@elizarov
, I have a core SharedFlow (like a message bus), and I want it to keep working even when some exceptions occur.
Lance Gao
06/01/2023, 2:12 AM
Thanks
@Francesc
, I’ll try it
238
Views
Open in Slack
Previous
Next