Skip to content
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

DI: Add coroutine dispatchers module and inject dependencies #493

Merged
merged 2 commits into from
Jan 3, 2025

Conversation

ksharma-xyz
Copy link
Owner

@ksharma-xyz ksharma-xyz commented Dec 27, 2024

TL;DR

Introduced a centralized coroutine dispatchers management system through dependency injection.

What changed?

  • Created a new DispatchersComponent class to manage coroutine dispatchers (IO, Default, Main)
  • Added a new coroutineDispatchersModule for Koin dependency injection
  • Integrated dispatcher management into the remote config implementation
  • Replaced direct Dispatchers references with injected dispatchers
  • Added core:di module

Why make this change?

This change improves testability and maintainability by:

  • Centralizing dispatcher management
  • Making it easier to swap dispatchers during testing
  • Providing a consistent way to access coroutine dispatchers across the application
  • Reducing direct dependencies on Kotlin's Dispatchers class

Copy link
Owner Author

ksharma-xyz commented Dec 27, 2024

@ksharma-xyz ksharma-xyz changed the title Provide Dispatchers using Koin DI: Add coroutine dispatchers module and inject dependencies Dec 27, 2024
@ksharma-xyz ksharma-xyz force-pushed the 12-26-firebase_remoteconfig branch from 0b7b8ca to 0f28342 Compare December 27, 2024 11:46
@ksharma-xyz ksharma-xyz added this to the 1.0.4 milestone Dec 27, 2024
Base automatically changed from 12-26-firebase_remoteconfig to main December 27, 2024 11:59
@ksharma-xyz ksharma-xyz modified the milestones: 1.0.4, 1.0.5 Dec 29, 2024
@ksharma-xyz ksharma-xyz force-pushed the 12-27-provide_dispatchers_using_koin branch from 83a4690 to 774cbe3 Compare January 3, 2025 02:37
@ksharma-xyz ksharma-xyz marked this pull request as ready for review January 3, 2025 02:38
@ksharma-xyz ksharma-xyz merged commit 9c7ca5c into main Jan 3, 2025
4 checks passed
Copy link
Owner Author

Merge activity

  • Jan 2, 9:51 PM EST: A user merged this pull request with Graphite.

@ksharma-xyz ksharma-xyz deleted the 12-27-provide_dispatchers_using_koin branch January 3, 2025 02:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant