feat(runtime): replace tokio+reqwest with asupersync async runtime
- Add HTTP adapter layer (src/http.rs) wrapping asupersync h1 client - Migrate gitlab client, graphql, and ollama to HTTP adapter - Swap entrypoint from #[tokio::main] to RuntimeBuilder::new().block_on() - Rewrite signal handler for asupersync (RuntimeHandle::spawn + ctrl_c()) - Migrate rate limiter sleeps to asupersync::time::sleep(wall_now(), d) - Add asupersync-native HTTP integration tests - Convert timeline_seed_tests to RuntimeBuilder pattern Phases 1-3 of asupersync migration (atomic: code won't compile without all pieces).
This commit is contained in:
@@ -1,16 +1,18 @@
|
||||
use std::sync::Arc;
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
|
||||
use asupersync::runtime::RuntimeHandle;
|
||||
|
||||
/// Spawn a background task that listens for Ctrl+C.
|
||||
///
|
||||
/// First press: cancels `signal` and prints an interrupt message.
|
||||
/// Second press: force-exits with code 130.
|
||||
pub fn install_ctrl_c_handler(signal: ShutdownSignal) {
|
||||
tokio::spawn(async move {
|
||||
let _ = tokio::signal::ctrl_c().await;
|
||||
pub fn install_ctrl_c_handler(handle: &RuntimeHandle, signal: ShutdownSignal) {
|
||||
handle.spawn(async move {
|
||||
let _ = asupersync::signal::ctrl_c().await;
|
||||
eprintln!("\nInterrupted, finishing current batch... (Ctrl+C again to force quit)");
|
||||
signal.cancel();
|
||||
let _ = tokio::signal::ctrl_c().await;
|
||||
let _ = asupersync::signal::ctrl_c().await;
|
||||
std::process::exit(130);
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user