zjuhasz
10/26/2018, 1:02 PMsuspend fun main()
could start a single threaded dispatcher which would be the main dispatcher.
You can make your own single threaded dispatcher for applications but it's a problem for libraries. Libraries can't safely use Dispatchers.Main
because there is no gaurentee there will be an implementation in a users application. A library developer could require there to be an implementation of Dispatcher.Main meaning that if the user wasn't making a UI app they would have to provide their own implementation, but that seems to go against the docs.
Also the documentation doesn't even say the main dispatcher must be single threaded, so it couldn't really be used as a home for operations that aren't thread safe anyway.elizarov
10/26/2018, 2:53 PMzjuhasz
10/26/2018, 2:56 PMelizarov
10/26/2018, 8:28 PM