baxter
08/20/2025, 6:40 PMoverride fun getSomeFlow(): Flow<String> =
localDataFlow
.onStart {
// Fire-and-forget, but still tied to the collector's lifecycle.
CoroutineScope(currentCoroutineContext()).launch {
triggerSomePrefetchCaching()
}
}
.map { data ->
data.toSomeString()
}
baxter
08/20/2025, 6:43 PMonStart
delay completion until all coroutines launched this way have completed (similar to coroutineScope {}
being called)?Joffrey
08/20/2025, 8:01 PMCoroutineScope
for no apparent reasonbaxter
08/20/2025, 8:03 PMCasey Brooks
08/20/2025, 8:57 PMflow { }
builder and launching the prefetch Coroutine in that block.