Aaron Stacy
01/03/2020, 3:49 AMsuspend fun main() = withContext(Executors.newSingleThreadExecutor().asCoroutineDispatcher()) {}
Even if I call cancel() from within the withContext block, I see an exception logged, but the program just hangs.octylFractal
01/03/2020, 3:52 AMDico
01/03/2020, 11:08 AMThiyagu
01/03/2020, 12:32 PMDispatcher.close()
method.https://gist.github.com/thiyagu06/9813da5a5b12ad91ce0ad8b26043d867Aaron Stacy
01/03/2020, 2:39 PMclose()
workedAaron Stacy
01/03/2020, 2:39 PMAaron Stacy
01/03/2020, 2:47 PMThreadPoolExecutor
javadoc saying that by default, the thread is not a daemon, but it's surprising because I'd think a "daemon" would need to be explicitly exited.Dico
01/03/2020, 2:48 PMAaron Stacy
01/03/2020, 2:49 PMThiyagu
01/03/2020, 2:56 PMThreadFactory
implementation to the executor.louiscad
01/04/2020, 6:11 PMfun main() = runBlocking { ... }
to it doesn't waste a bunch of threads (namely, the JVM main thread and the threads from Dispatchers.Default).Aaron Stacy
01/16/2020, 2:56 PM