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