-
Notifications
You must be signed in to change notification settings - Fork 5
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
Make fromApplication call non-blocking the UI thread #94
Make fromApplication call non-blocking the UI thread #94
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
❤️
@@ -21,9 +23,11 @@ public class WhetstoneWorkerInitializer : Initializer<WorkManager> { | |||
|
|||
|
|||
private fun Whetstone.installWorkerFactory(application: Application) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
random thought, non-blocking. is there merit to making this function a suspending function called in a coroutine scope? those are also non-blocking even when called on the main thread. cc @vsdeni
* upstream/main: Prepare for release 0.8.0 Revert "Prepare for release X.Y.Z" Prepare for release X.Y.Z Make fromApplication call non-blocking the UI thread (deliveryhero#94)
* 'main' of https://github.com/deliveryhero/whetstone: Prepare next development version 0.8.5-SNAPSHOT. Update sonatype credentials. Prepare next development version. Prepare for release. [MDEVVEL-9] Update dagger version (deliveryhero#99) Prepare next development version. Prepare for release 0.8.2. Revert the deliveryhero#94 (deliveryhero#98) Prepare next development version. Prepare for release 0.8.1. Return nulls from MultibindingWorkerFactory for non-existent Worker classes instead of throwing exceptions (deliveryhero#96)
Offload call to the
fromApplication
method to IO dispatcher, so that it doesn't block UI thread when creating AppComponent.This should help to avoid possible ANRs on low-end devices, when the component creation might also clash with GC and cause a delay.