aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/mozart/src/main.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-02-22 11:07:42 +0900
committernsfisis <nsfisis@gmail.com>2026-02-22 11:15:29 +0900
commit9f0d210021c54f63c9984446862b6ec68834bc63 (patch)
treed1522b8047c60bc7ee7a9d832178dd24e1b07636 /crates/mozart/src/main.rs
parent2c243a3cb814939bbe40fda1608781825ab0d77d (diff)
downloadphp-mozart-9f0d210021c54f63c9984446862b6ec68834bc63.tar.gz
php-mozart-9f0d210021c54f63c9984446862b6ec68834bc63.tar.zst
php-mozart-9f0d210021c54f63c9984446862b6ec68834bc63.zip
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 <noreply@anthropic.com>
Diffstat (limited to 'crates/mozart/src/main.rs')
-rw-r--r--crates/mozart/src/main.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/crates/mozart/src/main.rs b/crates/mozart/src/main.rs
index ebe84e5..04dd6d1 100644
--- a/crates/mozart/src/main.rs
+++ b/crates/mozart/src/main.rs
@@ -1,7 +1,7 @@
use clap::Parser;
use mozart::commands;
use mozart_core::exit_code;
-use tracing_subscriber::{fmt, prelude::*, EnvFilter};
+use tracing_subscriber::{EnvFilter, fmt, prelude::*};
fn init_tracing(profile: bool, verbose: u8, quiet: bool) {
// MOZART_LOG environment variable takes highest priority.
@@ -37,10 +37,11 @@ fn init_tracing(profile: bool, verbose: u8, quiet: bool) {
// Otherwise: no subscriber installed → tracing macros are effectively zero-cost no-ops.
}
-fn main() {
+#[tokio::main]
+async fn main() {
let cli = commands::Cli::parse();
init_tracing(cli.profile, cli.verbose, cli.quiet);
- match commands::execute(&cli) {
+ match commands::execute(&cli).await {
Ok(()) => {}
Err(e) => {
// Check if this is a structured MozartError with a specific exit code.