Are `actor` send channels automatically closed at ...
# coroutines
d
Are
actor
send channels automatically closed at the end of the
coroutineScope { }
that they're declared in?
g
No, actor have to be closed (or finish own block which cause close), otherwise coroutineScope will never return to avoid leaking coroutine
d
And if I seperate it into a Channel/launch-with-for-loop-over-the-channel declaration, will it still hang the scope, and leak the launch? I thought structured concurrency cleans/cancels up everything when you return from it's scope. I'm asking because I'm trying to track down a funny hang in my app, and I'm trying to reason out the cause, and I'm doscovering I'm not 100% able to reason through all of structured concurrency yet (the finer points), even after reading the docs and all.
Thanks @gildor, that was my bug, your explanation helped me find it 😉
👍 1