mbonnin
10/28/2023, 1:42 PMCoroutineScope
? If all the child coroutines eventually terminate, will everything be garbage collected or am I risking a memory leak somewhere?Chris Fillmore
10/28/2023, 3:35 PMmbonnin
10/28/2023, 3:36 PMCoroutineScope()
franztesca
10/28/2023, 4:38 PMgildor
10/31/2023, 7:40 AMmbonnin
10/31/2023, 9:50 AMThere is a risk of memory leak if you have never-ending operations on this scope👍 But if all my coroutines terminate then it's safe, right? Use case is a TCP connection keep alive. I'm fine with the connection stays alive ~30s in the background if it saves users a call to
.close()
gildor
10/31/2023, 12:09 PMgildor
10/31/2023, 12:10 PMgildor
10/31/2023, 12:12 PMmbonnin
10/31/2023, 12:56 PMclose()
could be used to force close the connection if you really need to reclaim resources faster but that the default would be to just let the connection time out.gildor
10/31/2023, 12:57 PMmbonnin
10/31/2023, 12:58 PMmbonnin
10/31/2023, 12:59 PMgildor
10/31/2023, 1:08 PMgildor
10/31/2023, 1:10 PMgildor
10/31/2023, 1:12 PMmbonnin
10/31/2023, 1:14 PMmbonnin
10/31/2023, 1:14 PMmbonnin
10/31/2023, 1:14 PMCloseable
?gildor
10/31/2023, 1:15 PMmbonnin
10/31/2023, 1:15 PMjob
isn't that much of a pattern yet (but maybe it should)gildor
10/31/2023, 1:16 PMgildor
10/31/2023, 1:17 PMmbonnin
10/31/2023, 1:18 PMlouiscad
11/02/2023, 5:02 PMmbonnin
11/02/2023, 6:16 PM