From 9f0d210021c54f63c9984446862b6ec68834bc63 Mon Sep 17 00:00:00 2001 From: nsfisis Date: Sun, 22 Feb 2026 11:07:42 +0900 Subject: refactor(async): migrate from blocking HTTP to async/await with tokio Replace reqwest::blocking with async reqwest across the entire codebase. All command execute functions, registry API calls (packagist, downloader, resolver, lockfile), and the main entry point now use async/await with the tokio runtime. The pubgrub resolver runs on spawn_blocking since its DependencyProvider trait is synchronous, using Handle::block_on for async I/O within that context. Co-Authored-By: Claude Opus 4.6 --- crates/mozart/src/commands/install.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'crates/mozart/src/commands/install.rs') diff --git a/crates/mozart/src/commands/install.rs b/crates/mozart/src/commands/install.rs index 1094d99..d55ba72 100644 --- a/crates/mozart/src/commands/install.rs +++ b/crates/mozart/src/commands/install.rs @@ -310,7 +310,7 @@ fn make_progress(show: bool, pkg_name: &str, version: &str) -> downloader::Downl /// 7. Writes vendor/composer/installed.json /// 8. Cleans up empty vendor directories /// 9. Generates the autoloader (unless no_autoloader) -pub fn install_from_lock( +pub async fn install_from_lock( lock: &lockfile::LockFile, working_dir: &Path, vendor_dir: &Path, @@ -418,7 +418,8 @@ pub fn install_from_lock( &pkg.name, Some(&mut progress), None, - )?; + ) + .await?; progress.finish(); } @@ -496,7 +497,7 @@ pub fn install_from_lock( Ok(()) } -pub fn execute( +pub async fn execute( args: &InstallArgs, cli: &super::Cli, console: &mozart_core::console::Console, @@ -590,6 +591,7 @@ pub fn execute( apcu_autoloader_prefix: args.apcu_autoloader_prefix.clone(), }, ) + .await } #[cfg(test)] -- cgit v1.3.1