Stop xmpp thread by shudown

[?]
Oct 27, 2018, 2:21 PM
AVBHYHOA3PGALA7WNBMKYV3BOPJTBPJEMECMEVM5YFI2KZSNE5OQC

Dependencies

  • [2] 6DSWVNSY Launch single-thread executor on own thread
  • [3] HKSQO7JZ Enable hyper http server and configuration
  • [4] FVVPKFTL Initial commit

Change contents

  • file addition: xmpp.rs (-xw-x--x--)
    [3.6]
    use tokio::prelude::future;
    pub fn xmpp_process<F>(signal: F) -> impl future::Future<Item = (), Error = tokio::io::Error>
    where
    F: future::Future<Item = ()>,
    {
    signal.map_err(|_| tokio::io::Error::new(tokio::io::ErrorKind::Other, "Wrong shutdown signal"))
    }
  • edit in src/main.rs at line 17
    [3.275][2.49:77]()
    use tokio::prelude::future;
  • edit in src/main.rs at line 22
    [3.337]
    [3.337]
    mod xmpp;
    use xmpp::xmpp_process;
  • replacement in src/main.rs at line 63
    [2.205][2.205:281]()
    let xmpp_join = std::thread::spawn(|| -> Result<(), tokio::io::Error> {
    [2.205]
    [2.281]
    let xmpp_join = std::thread::spawn(move || -> Result<(), tokio::io::Error> {
  • replacement in src/main.rs at line 66
    [2.379][2.379:440]()
    ctrt.block_on(future::ok::<_, tokio::io::Error>(()))
    [2.379]
    [2.440]
    ctrt.block_on(xmpp_process(ctrl_c.clone().map(|_| ())))