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
Similar to #14 , uploading multiple files in a single session significantly improves performance. I want to try downloading multiple files in a single session, but what perplexes me is that it gets blocked during the response reading process until it times out
asyncfntest_upload_data(mutsftp:SftpSession,file_count:i32,file_size:i32){letmut handler_vec = Vec::new();let start_time = Instant::now();let dir = sftp.read_dir("data-sync").await.unwrap();for dir_file in dir {let path = format!("data-sync/{}", dir_file.file_name());letmut file = sftp.open_with_flags(
path.clone(),OpenFlags::READ,).await.unwrap();letmut dest = fs_File::create(path.clone()).unwrap();let handler = task::spawn(asyncmove{let start_time = Instant::now();letmut buffer = Vec::new();
file.read_to_end(&mut buffer).await.unwrap();let elapsed_time = start_time.elapsed();println!("read_all Time elapsed: {:?}", elapsed_time);
dest.write_all(&buffer).unwrap();let elapsed_time = start_time.elapsed();println!("writr_all Time elapsed: {:?}", elapsed_time);});
handler_vec.push(handler);}
futures::future::join_all(handler_vec).await;let elapsed_time = start_time.elapsed();println!("Time elapsed: {:?}", elapsed_time);}
Does anyone have any insights into this?
The text was updated successfully, but these errors were encountered:
Similar to #14 , uploading multiple files in a single session significantly improves performance. I want to try downloading multiple files in a single session, but what perplexes me is that it gets blocked during the response reading process until it times out
Does anyone have any insights into this?
The text was updated successfully, but these errors were encountered: