Last active
January 10, 2019 23:30
-
-
Save prof18/7fa549bda752f37e054d13660e74fe79 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
@Throws(Exception::class) | |
suspend fun getArticles(url: String) = | |
withContext(Dispatchers.IO) { | |
val xml = async { CoroutineEngine.fetchXML(url) } | |
return@withContext CoroutineEngine.parseXML(xml) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment