Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
class MainPresenter(private val view: MainView,
private val dataProvider: DataProviderAPI) {
private fun loadData() = launch(UI) { // UI - dispatches execution onto Android main UI thread
// CommonPool - represents common pool of shared threads as coroutine dispatcher
val task = async(CommonPool) { dataProvider.loadData("Task") }
val result = task.await()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment