Update doc of mod async_extracter

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2022-06-18 18:12:48 +10:00
parent b152358175
commit 9de8a4841f
No known key found for this signature in database
GPG key ID: 591C0B03040416D6

View file

@ -1,14 +1,12 @@
//! # Advantages //! # Advantages
//! //!
//! Using this mod has the following advantages over downloading //! Using this mod has the following advantages over downloading
//! and extracting in on the async thread: //! to file then extracting:
//! //!
//! - The code is pipelined instead of storing the downloaded file in memory //! - The code is pipelined instead of storing the downloaded file in memory
//! and extract it, except for `PkgFmt::Zip`, since `ZipArchiver::new` //! and extract it, except for `PkgFmt::Zip`, since `ZipArchiver::new`
//! requires `std::io::Seek`, so it fallbacks to writing the a file then //! requires `std::io::Seek`, so it fallbacks to writing the a file then
//! unzip it. //! unzip it.
//! - The async part (downloading) and the extracting part runs in parallel
//! using `tokio::spawn_nonblocking`.
//! - Compressing/writing which takes a lot of CPU time will not block //! - Compressing/writing which takes a lot of CPU time will not block
//! the runtime anymore. //! the runtime anymore.
//! - For all `tar` based formats, it can extract only specified files and //! - For all `tar` based formats, it can extract only specified files and