use crate::input;

pub async fn run() {
    tokio::spawn(async {
        // give a bit of time for stdout
        use tokio::time::{Duration, sleep};
        sleep(Duration::from_millis(200)).await;

        if let Err(e) = input::forward_requests_from_socket().await {
            eprintln!("failed to forwards requests from socket: {e}");
            std::process::exit(1);
        }
    });
    input::answer_requests_from_stdin().await;
}
