This ``` open class CoroutineContextProvider { ...
# coroutines
j
This
Copy code
open class CoroutineContextProvider {
    open val Main: CoroutineContext by lazy { UI }
    open val IO: CoroutineContext by lazy { CommonPool }
}
Is the same as :
Copy code
open class CoroutineContextProvider {
    open val main: CoroutineContext by lazy { Dispatchers.Main }
    open val IO: CoroutineContext by lazy { <http://Dispatchers.IO|Dispatchers.IO> }
}
I was using experimental coroutines and now I have to update them
t
Also, you probably won't need those properties to be `lazy`: objects are lazy instantiated and properties of the
Dispatchers
object are not costly to create.
k
Experimental means there can be breaking changes, and backwards compatibility isn't guaranteed
g
It's not exactly the same for CommonPool/IO, they have different threading strategies, but yes, for IO use IO dispatcher, it has own thread limits and also shares threads with Default dispatcher
j
So it's the same right? OK I can remove the lazy thing
g
Not exactly, but anyway, CommonPool is deprecated and IO has better strategy for blocking IO usecase