question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Make Android UI dispatcher asynchronous by default

See original GitHub issue

See discussion in #381

We can make UI asynchronous by default and provide a fallback (system property?) for sync behaviour and something like SyncUI.

Asynchronous handlers are the new feature in Android and it’s unclear for us (as we’re not Android devs) whether it’s sane default which is safe to expose, so we’d like to hear community opinion on this.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:6
  • Comments:12 (7 by maintainers)

github_iconTop GitHub Comments

8reactions
JakeWhartoncommented, Sep 17, 2018

I’m doing it. I spent 2m making the change and am entering hour 2 writing tests.

On Mon, Sep 17, 2018 at 2:03 PM Louis CAD notifications@github.com wrote:

Can’t agree more. Did anyone started a PR? If not, I’ll be happy to take it as my first non typo fix PR for this repo.

On Mon, Sep 17, 2018, 4:53 PM Adam Powell notifications@github.com wrote:

Giving this a bump now that UI has become Dispatchers.Main. Now that this is generalized beyond UI into all other main looper tasks it would be great to get this default behavior change in for 1.0 so that coroutines-based code doesn’t start relying on the compatibility vsync barrier behavior out of the gate.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub < https://github.com/Kotlin/kotlinx.coroutines/issues/427#issuecomment-422047742 , or mute the thread < https://github.com/notifications/unsubscribe-auth/AGpvBVw1rG9H_EUSXwBfQMjgsEulxwVZks5ub7eBgaJpZM4VGu7I

.

— You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub https://github.com/Kotlin/kotlinx.coroutines/issues/427#issuecomment-422113536, or mute the thread https://github.com/notifications/unsubscribe-auth/AAEEEQqEIdewSHxEG6NoiVAB5r6XfsT2ks5ub-P6gaJpZM4VGu7I .

3reactions
ZakTaccardicommented, Aug 16, 2018
Read more comments on GitHub >

github_iconTop Results From Across the Web

Improve app performance with Kotlin coroutines
Kotlin coroutines enable you to write clean, simplified asynchronous code that keeps your app responsive while managing long-running tasks ...
Read more >
Update UI async call with coroutines - android - Stack Overflow
Make sure to have the Android Coroutine library installed so that Main Dispatcher correctly recognises the Android Main Thread.
Read more >
Coroutine context and dispatchers - Kotlin
All coroutine builders like launch and async accept an optional CoroutineContext parameter that can be used to explicitly specify the dispatcher ...
Read more >
Kotlin Coroutines And Threading Fundamentals
Coroutine by default runs off the main thread. If you want to switch the thread Kotlin has Dispatchers to do that for you....
Read more >
Deep Dive into Dispatchers for Kotlin Coroutines - Medium
Dispatchers.Default: The default CoroutineDispatcher that is used by all standard builders like launch, async, etc. if no dispatcher nor any other ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found