Closed MohamedTaher closed 7 years ago
the app is stuck and not responsible
runBlocking
blocks the thread and should be used only when it's fine for you, but it's definitely wrong for UI thread. Replace it with launch(DispatcherOnYourChoice)
where DispatcherOnYourChoice
can be UI (if you want to touch views inside your coroutine) or any other dispatcher, depending on your case.
also it's not throwing any exception
I don't see a case when your code could throw an exception. Could you please explain your problem.
Please read Guide to UI programming with coroutines
@MohamedTaher I just realized that my examples could be confusing for people who never used coroutines, so I added a note about runBlocking
to Readme
Now I use launch(UI) instead of runBlocking and It's working well Thanks a lot
I use awaitResult method
the app is stuck and not responsible, also it's not throwing any exception it isn't entered in onResponse and onFailure functions at CallAwait.awaitResult()