Open JakeWharton opened 1 month ago
For context, it was originally added in #428 as an experiment. As far as I know, it is very rarely used (if at all) in the ecosystem.
Very few usages found: https://grep.app/search?q=.IO%20%7B&case=true&filter[lang][0]=Kotlin https://grep.app/search?q=Dispatchers.Default%20%7B&case=true&filter[lang][0]=Kotlin https://grep.app/search?q=Dispatchers.Main%20%7B&case=true&words=true&filter[lang][0]=Kotlin
I personally find this to be non-idiomatic modern Kotlin. Thing { }
looks to me like a builder of some sort. So, I'm for this.
We can try and proceed with it in RC2 along with other deprecations
I'm not sure what I expected, but the deprecation doesn't look pretty in the IDE! Given how rare this is, I don't think this should stop us, though.
Finding some good IntelliJ bugs/feature requests at least!
CoroutineDispatcher.invoke
, a function used as such:is a shorter version of
withContext
that only works with dispatchers.Does this function need to exist? It seems to predate structured concurrency and is so terse that it offers no indication as to its underlying behavior. Does it launch a new coroutine? Does it move the current coroutine? Does the supplied block honor structured concurrency?
I personally have a hard time finding a reason for this function to continue to exist.