Created
February 17, 2020 20:37
-
-
Save jorgecasariego/cbf0b94e14e70b312742120319cebc20 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Dispatchers.Main | |
suspend fun fetchDocs() { | |
// Dispatchers.Main | |
val result = get("developer.android.com") | |
// Dispatchers.Main | |
show(result) | |
} | |
// Dispatchers.Main | |
suspend fun get(url: String) = | |
// Dispatchers.Main | |
withContext(Dispatchers.IO) { | |
// Dispatchers.IO | |
/* perform blocking network IO here */ | |
} | |
// Dispatchers.Main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment