You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/bootstrap/jobs/http_tracker.rs
+20Lines changed: 20 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,16 @@
1
+
//! HTTP tracker job starter.
2
+
//!
3
+
//! The function [`http_tracker::start_job`](crate::bootstrap::jobs::http_tracker::start_job) starts a new HTTP tracker server.
4
+
//!
5
+
//! > **NOTICE**: the application can launch more than one HTTP tracker on different ports.
6
+
//! Refer to the [configuration documentation](https://docs.rs/torrust-tracker-configuration) for the configuration options.
7
+
//!
8
+
//! The [`http_tracker::start_job`](crate::bootstrap::jobs::http_tracker::start_job) function spawns a new asynchronous task,
9
+
//! that tasks is the "**launcher**". The "**launcher**" starts the actual server and sends a message back to the main application.
10
+
//! The main application waits until receives the message [`ServerJobStarted`](crate::bootstrap::jobs::http_tracker::ServerJobStarted) from the "**launcher**".
11
+
//!
12
+
//! The "**launcher**" is an intermediary thread that decouples the HTTP servers from the process that handles it. The HTTP could be used independently in the future.
13
+
//! In that case it would not need to notify a parent process.
1
14
use std::sync::Arc;
2
15
3
16
use axum_server::tls_rustls::RustlsConfig;
@@ -10,9 +23,16 @@ use crate::servers::http::v1::launcher;
10
23
usecrate::servers::http::Version;
11
24
usecrate::tracker;
12
25
26
+
/// This is the message that the "**launcher**" spawned task sends to the main application process to notify that the HTTP server was successfully started.
27
+
///
28
+
/// > **NOTICE**: it does not mean the HTTP server is ready to receive requests. It only means the new server started. It might take some time to the server to be ready to accept request.
13
29
#[derive(Debug)]
14
30
pubstructServerJobStarted();
15
31
32
+
/// It starts a new HTTP server with the provided configuration and version.
33
+
///
34
+
/// Right now there is only one version but in the future we could support more than one HTTP tracker version at the same time.
35
+
/// This feature allows supporting breaking changes on `BitTorrent` BEPs.
0 commit comments