coroutine dispatcher for network calls code example
Example: coroutine dispatcher for network
+-----------------------------------+| Dispatchers.Main |+-----------------------------------+| Main thread on Android, interact || with the UI and perform light || work |+-----------------------------------+| - Calling suspend functions || - Call UI functions || - Updating LiveData |+-----------------------------------++-----------------------------------+| Dispatchers.IO |+-----------------------------------+| Optimized for disk and network IO || off the main thread |+-----------------------------------+| - Database* || - Reading/writing files || - Networking** |+-----------------------------------++-----------------------------------+| Dispatchers.Default |+-----------------------------------+| Optimized for CPU intensive work || off the main thread |+-----------------------------------+| - Sorting a list || - Parsing JSON || - DiffUtils |+-----------------------------------+