https://kotlinlang.org logo
#coroutines
Title
# coroutines
b

bod

04/15/2021, 7:51 PM
Hello, World! It's a small thing, but I noticed that when I have a simple program with a
suspend fun main()
, the program doesn't exit at the end of the
main
. It's not big deal since I can of course manually end it with
exitProcess(0)
but I'm wondering if I'm doing something wrong, or is this normal?
l

louiscad

04/15/2021, 8:07 PM
Probably a thread pool is kept somewhere, I'd think
Dispatchers.Default
. I think there's even a related issue on GitHub.
u

uli

04/16/2021, 6:52 AM
Did all your coroutines terminate? Can you post code?
b

bod

04/16/2021, 6:56 AM
well it's just a very simple program that uses the Retrofit library to do a network call. So it looks like
Copy code
suspend fun main(args: Array<String>) {
    makeApiCall()
}
Could this be related to Retrofit?
l

louiscad

04/16/2021, 6:58 AM
Yes, related to OkHttp thread pool
b

bod

04/16/2021, 7:39 AM
all right well . . . 🙂
I'll keep
exitProcess(0)
🙂