-
Notifications
You must be signed in to change notification settings - Fork 99
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
Don't hard code Dispatchers.Main.immediate #600
Comments
Also consider adding a useful name to the scope, e.g.: val scopeName = window.peekDecorView()?.getTag(R.id.workflow_modal_dialog_content)
?.let { contentView ->
contentView as View
contentView.getRendering<Any>()?.toString()
}
?: this@maintainBounds.toString()
scope = CoroutineScope(Dispatchers.Main.immediate + CoroutineName(scopeName)).also { |
@steve-the-edwards @RBusarow @vRallev Thinking about this hard coded
tl;dr: no harm, no foul, let's not introduce complexity that won't solve any actual problems. |
It's not a big deal. Espresso handles syncing with the main thread automatically. Hard-coded dispatchers only become a problem if you leave the main thread, and there's basically zero risk of that here. |
The only remaining non-test, non-deprecated use of this is in override fun onAttachedToWindow() {
scope = CoroutineScope(Dispatchers.Main.immediate).also {
bounds.onEach { b -> onBoundsChange(this@maintainBounds, b) }
.launchIn(it)
}
} |
WorkflowLayout
and nowAndroidDialogBounds.kt
hard code use ofDispatchers.Main.immediate
. Make them look for that in theViewEnvironment
. Maybe also give them a shared implementation ofView.takeWhileAttached
. Maybe.The text was updated successfully, but these errors were encountered: