Skip to content

Allow overriding default CoroutineDispatcher for WorkerBinder calls#596

Merged
FranAguilera merged 2 commits into
uber:mainfrom
FranAguilera:add_migration_api
Jun 16, 2023
Merged

Allow overriding default CoroutineDispatcher for WorkerBinder calls#596
FranAguilera merged 2 commits into
uber:mainfrom
FranAguilera:add_migration_api

Conversation

@FranAguilera

@FranAguilera FranAguilera commented Jun 13, 2023

Copy link
Copy Markdown
Contributor

Description:
WorkerBinder/Worker is going away in favor of RibCoroutineWorker. Still we would like to provide a mechanism to change the default CoroutineDispatcher being used at WorkerBinder.bind calls to be other than Unconfined.

This is given that the effective threading for binding those calls happens on the main thread, potentially leading to Jank, ANR, freezes, etc.

Related issue(s):

Current Workers being bound on Main thread.

Verification:

  • Verified on rib-workers demo app
    image

  • Existing JUnit tests

@FranAguilera FranAguilera force-pushed the add_migration_api branch 2 times, most recently from 61a4bbb to 9cba3a5 Compare June 13, 2023 19:49
@FranAguilera FranAguilera added the Android Android related tickets label Jun 13, 2023
Comment thread android/libraries/rib-base/src/main/kotlin/com/uber/rib/core/WorkerBinder.kt Outdated
@FranAguilera FranAguilera force-pushed the add_migration_api branch 2 times, most recently from 39afa0d to 169edf3 Compare June 14, 2023 23:29
- Define a dispatchers to be used on the now deprecated WorkerBinder/Worker within RibCoroutineConfig

@tyvsmith tyvsmith left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing the changes we discussed.

@FranAguilera FranAguilera merged commit 7e40711 into uber:main Jun 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Android Android related tickets

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants