-
Notifications
You must be signed in to change notification settings - Fork 46
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
Overhaul core Tracker: create dependency containers for UDP tracker, HTTP tracker and Tracker API #1217
Labels
Comments
josecelano
added a commit
to josecelano/torrust-tracker
that referenced
this issue
Jan 28, 2025
3 tasks
josecelano
added a commit
to josecelano/torrust-tracker
that referenced
this issue
Jan 29, 2025
josecelano
added a commit
to josecelano/torrust-tracker
that referenced
this issue
Jan 29, 2025
josecelano
added a commit
to josecelano/torrust-tracker
that referenced
this issue
Jan 29, 2025
josecelano
added a commit
to josecelano/torrust-tracker
that referenced
this issue
Jan 29, 2025
josecelano
added a commit
to josecelano/torrust-tracker
that referenced
this issue
Jan 29, 2025
I considered extracting also a struct CoreTrackerServices {
pub core_config: Arc<Core>,
pub announce_handler: Arc<AnnounceHandler>,
pub stats_event_sender: Arc<Option<Box<dyn Sender>>>,
pub whitelist_authorization: Arc<WhitelistAuthorization>,
pub authentication_service: Arc<AuthenticationService>,
}
struct CoreTrackerServices {
pub core_config: Arc<Core>,
pub scrape_handler: Arc<ScrapeHandler>,
pub stats_event_sender: Arc<Option<Box<dyn crate::core::statistics::event::sender::Sender>>>,
pub authentication_service: Arc<AuthenticationService>,
}
struct CoreTrackerServices {
pub core_config: Arc<Core>,
pub announce_handler: Arc<AnnounceHandler>,
pub stats_event_sender: Arc<Option<Box<dyn Sender>>>,
}
struct CoreTrackerServices {
pub core_config: Arc<Core>,
pub announce_handler: Arc<AnnounceHandler>,
pub scrape_handler: Arc<ScrapeHandler>,
pub in_memory_torrent_repository: Arc<InMemoryTorrentRepository>,
pub stats_event_sender: Arc<Option<Box<dyn Sender>>>,
pub in_memory_whitelist: Arc<InMemoryWhitelist>,
pub whitelist_authorization: Arc<whitelist::authorization::WhitelistAuthorization>,
} However I didn't do it because there are used only in tests and are not exactly the same. They only use the services they need for a concrete tests. |
josecelano
added a commit
that referenced
this issue
Jan 29, 2025
…UDP tracker, HTTP tracker and Tracker API b38e4af chore: add DevSkim ignore DS173237 (Jose Celano) 66b2b56 refactor: [#1217] extract HttpApiContainer (Jose Celano) a2bf1cd refactor: [#1217] extract HttpTrackerContainer (Jose Celano) 5342a5d refactor: [#1217] extract UdpTrackerContainer (Jose Celano) Pull request description: Overhaul core Tracker: create dependency containers for UDP tracker, HTTP tracker and Tracker API. ### Subtasks - [x] Extract `UdpTrackerContainer` - [x] Extract `HttpTrackerContainer` - [x] Extract `HttpApiContainer` ACKs for top commit: josecelano: ACK b38e4af Tree-SHA512: da14cb884920eaf7f7c249dace05596a61ee0532efb77cb4bd5c381e6c5d2b119d86f8f22764080b84c7f165c4fc524dce2eb4e311521728fdb81d172bda6164
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Parent issue: #1181
After refactoring the core Tracker (it was removed), all services are injected independently where they are needed.
This function signature is very common:
Where
announce_handler
,scrape_handler
,authentication_service
,whitelist_authorization
andstats_event_sender
are the services needed by this function.We could pass the
AppContainer
I have introduced in this core tracker overhaul:However the main three application user's services (UDP tracker, HTTP tracker and Tracker API) don't use the same services. My proposal is to create specific containers for those services:
UdpTrackerContainer
HttpTrackerContainer
TrackerApiContainer
cc @da2ce7
The text was updated successfully, but these errors were encountered: