pub fn block_until_ctrlc() {
    let (ctrlc_outlet, ctrlc_inlet) = futures::channel::oneshot::channel();
    let ctrlc_outlet = std::cell::RefCell::new(Some(ctrlc_outlet));

    ctrlc::set_handler(move || {
        println!("ctrlc fired!");
        if let Some(outlet) = ctrlc_outlet.borrow_mut().take() {
            outlet.send(()).expect("sending shutdown signal failed");
        }
    })
    .expect("Error while setting ctrlc handler");

    async_std::task::block_on(ctrlc_inlet).expect("exit oneshot failed");
}
// blocks until either SIGINT(Ctrl+C) or SIGTERM signals received
blocks until either SIGINT(Ctrl+C) or SIGTERM signals received
blocks until either SIGINT ( Ctrl + C ) or SIGTERM signals received
pub fn block_until_ctrlc() {
    let (ctrlc_outlet, ctrlc_inlet) = futures::channel::oneshot::channel();
    let ctrlc_outlet = std::cell::RefCell::new(Some(ctrlc_outlet));
    ctrlc::set_handler(move || {
        println!("ctrlc fired!");
        if let Some(outlet) = ctrlc_outlet.borrow_mut().take() {
            outlet.send(()).expect("sending shutdown signal failed");
        }
    })
    .expect("Error while setting ctrlc handler");
    async_std::task::block_on(ctrlc_inlet).expect("exit oneshot failed");
}
pub fn block_until_ctrlc ( ) { let ( ctrlc_outlet , ctrlc_inlet ) = futures :: channel :: oneshot :: channel ( ) ; let ctrlc_outlet = std :: cell :: RefCell :: new ( Some ( ctrlc_outlet ) ) ; ctrlc :: set_handler ( move | | { println ! ( " " ) ; if let Some ( outlet ) = ctrlc_outlet . borrow_mut ( ) . take ( ) { outlet . send ( ( ) ) . expect ( " " ) ; } } ) . expect ( " " ) ; async_std :: task :: block_on ( ctrlc_inlet ) . expect ( " " ) ; }
blocks until either SIGINT(Ctrl+C) or SIGTERM signals received
blocks until either SIGINT ( Ctrl + C ) or SIGTERM signals received