ForteScarlet / kotlin-suspend-transform-compiler-plugin

A Kotlin compiler plugin for transforming suspend functions to platform-compatible non-suspend functions, such as the JVM Blocking API and CompletableFuture 🐱
MIT License
33 stars 3 forks source link

优化 `runtime` 中的 JVM 平台实现:异步调度器默认使用 `GlobalScope` #50

Closed ForteScarlet closed 5 months ago

ForteScarlet commented 5 months ago

在没有提供 CoroutineScope 的情况下:比起使用一个在内部构建一个使用 Dispatchers.IO、并且永不被关闭的 CoroutineScope,为何不直接使用 GlobalScope

作为作用域:它用不被关闭、无法被关闭 作为异步调度器:它或许没必要使用 IO

而对于更加复杂的场景,也许需要考虑定制化,而不是使用 runtime 包内的简单实现