Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions src/api/downloader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,14 @@ pub enum DownloadProgressItem {
}

impl DownloaderActor {
fn new(store: Store, endpoint: Endpoint) -> Self {
fn new_with_opts(
store: Store,
endpoint: Endpoint,
pool_options: crate::util::connection_pool::Options,
) -> Self {
Self {
store,
pool: ConnectionPool::new(endpoint, crate::ALPN, Default::default()),
pool: ConnectionPool::new(endpoint, crate::ALPN, pool_options),
tasks: JoinSet::new(),
running: HashSet::new(),
}
Expand Down Expand Up @@ -341,8 +345,16 @@ impl IntoFuture for DownloadProgress {

impl Downloader {
pub fn new(store: &Store, endpoint: &Endpoint) -> Self {
Self::new_with_opts(store, endpoint, Default::default())
}

pub fn new_with_opts(
store: &Store,
endpoint: &Endpoint,
pool_options: crate::util::connection_pool::Options,
) -> Self {
let (tx, rx) = tokio::sync::mpsc::channel::<SwarmMsg>(32);
let actor = DownloaderActor::new(store.clone(), endpoint.clone());
let actor = DownloaderActor::new_with_opts(store.clone(), endpoint.clone(), pool_options);
n0_future::task::spawn(actor.run(rx));
Self { client: tx.into() }
}
Expand Down
Loading