Skip to content

Instantly share code, notes, and snippets.

@prof18
Last active January 10, 2019 23:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prof18/7fa549bda752f37e054d13660e74fe79 to your computer and use it in GitHub Desktop.
Save prof18/7fa549bda752f37e054d13660e74fe79 to your computer and use it in GitHub Desktop.
@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