Skip to content

Commit

Permalink
singleflight remove explicit threadpool (#169)
Browse files Browse the repository at this point in the history
Removing threadpool references in the singleflight crate. The crate uses
Handle::current().spawn() to spawn tasks. If a `work` call is issued
within a runtime within a xet_threadpool::ThreadPool runtime it will use
that tokio runtime handle to spawn tasks.
  • Loading branch information
assafvayner authored Feb 10, 2025
1 parent fc6c3c9 commit 85d6222
Show file tree
Hide file tree
Showing 2 changed files with 170 additions and 146 deletions.
4 changes: 2 additions & 2 deletions cas_client/src/remote_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ impl RemoteClient {
} else {
None
};
let range_download_single_flight = Arc::new(Group::new(threadpool.clone()));
let range_download_single_flight = Arc::new(Group::new());

Self {
endpoint: endpoint.to_string(),
Expand Down Expand Up @@ -632,7 +632,7 @@ mod tests {
compression: CompressionScheme::LZ4,
dry_run: false,
threadpool: threadpool.clone(),
range_download_single_flight: Arc::new(Group::new(threadpool.clone())),
range_download_single_flight: Arc::new(Group::new()),
};

let v = ThreadSafeBuffer::default();
Expand Down
Loading

0 comments on commit 85d6222

Please sign in to comment.