is it safe to write code like this: ```channelFlow...
# coroutines
m
is it safe to write code like this:
Copy code
channelFlow {
    flowOf(1, 2, 3, 4)
        .map { delay(100); it }
        .collect { send(it) }
}
I mean, when the channelFlow get's cancelled, it also cancels the inner flow right ? Because both have the same scope
p
Yes, both would be cancelled… but unless you oversimplified your example, I don’t understand why you need the outer flow
m
was just for the purpose of demo. The example makes no sense obviously 😛 thanks
l
delay
is cancellable, so if the flow is suspended here during cancellation, it will be cancelled properly