New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add option to define coroutineContext for coroutine functions #387
Add option to define coroutineContext for coroutine functions #387
Conversation
Codecov Report
@@ Coverage Diff @@
## master #387 +/- ##
===========================================
- Coverage 76.45% 76.25% -0.2%
Complexity 193 193
===========================================
Files 33 33
Lines 930 935 +5
Branches 161 164 +3
===========================================
+ Hits 711 713 +2
Misses 134 134
- Partials 85 88 +3
Continue to review full report at Codecov.
|
Was the CommonPool context in the coroutines code there before and accidentally removed or is there some other reason it needs to be here for the caller to only invoke launch(UI)? Not too familiar with coroutines, and am curious to know why it worked before. |
I think this is reasonable to merge. Do you think we should add test for checking on the execution thread as well? So that we could have tests that cover us in the future. |
@kittinunf I have had a look at writing a test for the execution thread and I have run into a bit of a dead end. if you perform a test inside runBlocking the that forces the scope to be run on the blocking thread. If anyone has any wise ideas they would be very gratefully received |
I haven't had any good idea either ... let's merge it. |
this will prevent networkonmainthread exception