Group session fields + add comments (Claude)
This commit is contained in:
parent
456a51d4db
commit
f637959ba7
1 changed files with 20 additions and 18 deletions
|
|
@ -97,39 +97,41 @@ impl SessionDatabase {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub struct Session {
|
pub struct Session {
|
||||||
peer_id: Id20,
|
// Core state and services
|
||||||
dht: Option<Dht>,
|
pub(crate) db: RwLock<SessionDatabase>,
|
||||||
persistence: Option<Arc<dyn SessionPersistenceStore>>,
|
|
||||||
pub(crate) bitv_factory: Arc<dyn BitVFactory>,
|
|
||||||
peer_opts: PeerConnectionOptions,
|
|
||||||
spawner: BlockingSpawner,
|
|
||||||
next_id: AtomicUsize,
|
next_id: AtomicUsize,
|
||||||
db: RwLock<SessionDatabase>,
|
pub(crate) bitv_factory: Arc<dyn BitVFactory>,
|
||||||
output_folder: PathBuf,
|
spawner: BlockingSpawner,
|
||||||
|
|
||||||
|
// Network
|
||||||
|
peer_id: Id20,
|
||||||
tcp_listen_port: Option<u16>,
|
tcp_listen_port: Option<u16>,
|
||||||
|
dht: Option<Dht>,
|
||||||
|
pub(crate) connector: Arc<StreamConnector>,
|
||||||
|
reqwest_client: reqwest::Client,
|
||||||
|
|
||||||
|
// Lifecycle management
|
||||||
cancellation_token: CancellationToken,
|
cancellation_token: CancellationToken,
|
||||||
|
_cancellation_token_drop_guard: DropGuard,
|
||||||
|
|
||||||
|
// Runtime settings
|
||||||
|
output_folder: PathBuf,
|
||||||
|
peer_opts: PeerConnectionOptions,
|
||||||
|
default_storage_factory: Option<BoxStorageFactory>,
|
||||||
|
persistence: Option<Arc<dyn SessionPersistenceStore>>,
|
||||||
disk_write_tx: Option<DiskWorkQueueSender>,
|
disk_write_tx: Option<DiskWorkQueueSender>,
|
||||||
|
|
||||||
default_storage_factory: Option<BoxStorageFactory>,
|
// Limits and throttling
|
||||||
|
|
||||||
reqwest_client: reqwest::Client,
|
|
||||||
pub(crate) connector: Arc<StreamConnector>,
|
|
||||||
pub(crate) concurrent_initialize_semaphore: Arc<tokio::sync::Semaphore>,
|
pub(crate) concurrent_initialize_semaphore: Arc<tokio::sync::Semaphore>,
|
||||||
|
|
||||||
root_span: Option<Span>,
|
|
||||||
|
|
||||||
pub(crate) ratelimits: Limits,
|
pub(crate) ratelimits: Limits,
|
||||||
|
|
||||||
|
// Monitoring / tracing / logging
|
||||||
pub(crate) stats: SessionStats,
|
pub(crate) stats: SessionStats,
|
||||||
|
root_span: Option<Span>,
|
||||||
|
|
||||||
|
// Feature flags
|
||||||
#[cfg(feature = "disable-upload")]
|
#[cfg(feature = "disable-upload")]
|
||||||
_disable_upload: bool,
|
_disable_upload: bool,
|
||||||
|
|
||||||
// This is stored for all tasks to stop when session is dropped.
|
|
||||||
_cancellation_token_drop_guard: DropGuard,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn torrent_from_url(
|
async fn torrent_from_url(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue