taer
02/02/2021, 10:12 PMfirst
but I don't want to close the flow. I need the rest of the elements to be still available.taer
02/02/2021, 10:19 PMval requests: Flow<Request>
val foo = requests.toList()
val targetServer = doSomethingWithFirstElement(foo.first())
targetServer.makeReuqest(foo.asFlow())
Tijl
02/02/2021, 10:28 PMshareIn
https://kotlin.github.io/kotlinx.coroutines/kotlinx-coroutines-core/kotlinx.coroutines.flow/share-in.html
then collect the SharedFlow
once with first
, and another time with a filter to omit the first item.taer
02/02/2021, 10:31 PMTijl
02/02/2021, 10:39 PM