https://kotlinlang.org logo
#coroutines
Title
# coroutines
d

Daniele Segato

07/13/2021, 2:40 PM
How can i trigger a non-blocking refresh inside a flow?
Copy code
getDataFlow()
  .onStart {
     coroutineScope {
         launch { repository.refresh() }
     } // this wait refresh to be finished
  }
the above code in onStart wait the refresh to finish according to
coroutineScope
documentation, I need the
repository.refresh()
to run in parallel and just be canceled with the flow
Nevermind, dumb question. I just need to envelope the flow in a wider coroutineContext and launch from it
6 Views