Created
October 10, 2018 05:45
-
-
Save alwarren/4906818a4cf774d8fcad13cf2fe89213 to your computer and use it in GitHub Desktop.
From RxJava async to Coroutines in two lines of code.
This file contains hidden or 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
val job = GlobalScope.async(Dispatchers.Default, CoroutineStart.DEFAULT, { MyApi.execute() }) | |
GlobalScope.launch(Dispatchers.Main, CoroutineStart.DEFAULT, { updateUi(job.await()) }) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment