```suspend fun main() { coroutineScope { flo...
# coroutines
n
Copy code
suspend fun main() {
	coroutineScope {
   		flowOf<Unit>().shareIn(this, SharingStarted.WhileSubscribed())
    }
}
https://pl.kotl.in/gaJVXPMWr = Evaluation stopped while it's taking too long️. Why? The child coroutine of shareIn should, according to docs, never start
ok looking at the source of shareIn both Lazily and WhileSubscribed will block forever until the first subscriber appears
Eagerly would complete
e
also shareIn always has to create a new child job (even for WhenStarted because it needs to live independently of the subscribers), which it can't close itself
n
thanks, what pattern do you suggest to create a scope that doesnt wait for its child when it completes? A kind of finiteCoroutineScope { ... } as coroutineScope { ...; cancel() } feels unnatural to me