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

Romanow

12/27/2018, 3:03 PM
Hi! Does anyone know how to stop the threads started by the
CoroutineScheduler
? I'm trying to use coroutines from a webapp, where kotlin is loaded by the webapp classloader, so I need to cleanup all resources that I allocated. For this I have my own
ExecutorCoroutineDispatcher
that is used trough the code based on a internal
ScheduledThreadPoolExecutor
. But this seems to still startup some default thread pools...
s

streetsofboston

12/27/2018, 3:13 PM
Shouldn’t calling
shutDown()
or
shutDownNow()
on your
ScheduledThreadPoolExecutor
do the proper clean-up?
r

Romanow

12/28/2018, 7:33 AM
I do that, and the threads in the backing
ScheduledThreadPoolExecutor
are cleaned correctly, but the container still reports that Worker threads are alive, spawned by
CoroutineScheduler
3 Views