Hello, World! It's a small thing, but I noticed t...
# coroutines
b
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
Probably a thread pool is kept somewhere, I'd think
Dispatchers.Default
. I think there's even a related issue on GitHub.
u
Did all your coroutines terminate? Can you post code?
b
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
Yes, related to OkHttp thread pool
b
all right well . . . 🙂
I'll keep
exitProcess(0)
🙂