How to join a Kotlin SupervisorJob
问题 I am trying to process a tree of data objects. Each tree leaf is supposed to be processed through a function using a coroutine. The whole process should be done using a fixed size threadpool. So I came up with this: val node = an instance of WorkspaceEntry (tree structure) val localDispatcher = newFixedThreadPoolContext(16) fun main() { val job = SupervisorJob() val scope = CoroutineScope(localDispatcher + job) handleEntry(node, scope) runBlocking { job.join() } } The handleEntry method