CLOVIS
11/01/2021, 5:36 PMOliver.O
11/01/2021, 5:39 PMCoroutineScope
is just an encapsulation of `coroutineContext`: The coroutine will retain a reference to that coroutine context (see AbstractCoroutine
). So it won't be garbage collected and the coroutine will live on until it completes (normally or cancelled).CLOVIS
11/01/2021, 6:06 PMOliver.O
11/01/2021, 6:17 PMephemient
11/01/2021, 8:48 PMOliver.O
11/01/2021, 9:07 PMephemient
11/01/2021, 9:25 PMsuspendCoroutine
can suspend a coroutine in a way that doesn't have outside references to its continuation to resumeOliver.O
11/01/2021, 10:38 PMsuspendCoroutine
. The library's user-facing API should ensure that there is always something watching a suspended continuation, be it a channel, a timer, a flow, whatever. Anything else is hopefully considered a bug and would get fixed. 😇Nick Allen
11/01/2021, 10:40 PM