Skip to content

fix(ad-hoc): Refactor coroutine scopes#219

Merged
vitalii-vanziak-cko merged 5 commits intomasterfrom
fix/ad-hoc/coroutine-scopes
Aug 23, 2024
Merged

fix(ad-hoc): Refactor coroutine scopes#219
vitalii-vanziak-cko merged 5 commits intomasterfrom
fix/ad-hoc/coroutine-scopes

Conversation

@vitalii-vanziak-cko
Copy link
Copy Markdown
Collaborator

Description

Refactored usages of coroutine scopes to apply the following rules:

  1. Created mainScope in ContextGraph. It used in all services and repositories whose scope should be active throughout the whole SDK/app lifetime. It never cancels.
  2. Dispatchers.Main.immediate used only in components responsible to update the UI (activity/VM/interactor) and bound to component lifecycle.
  3. Short lived components (like PODefaultProxy3DSService) have it's own MainScope() which is cancelled when component is not needed anymore.
  4. Other components will use the scope of parent component whenever possible (e.g. launchers use lifecycleScope).

@vitalii-vanziak-cko vitalii-vanziak-cko merged commit d0637d1 into master Aug 23, 2024
@vitalii-vanziak-cko vitalii-vanziak-cko deleted the fix/ad-hoc/coroutine-scopes branch August 23, 2024 15:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants