Stop xmpp thread by shudown
[?]
Oct 27, 2018, 2:21 PM
AVBHYHOA3PGALA7WNBMKYV3BOPJTBPJEMECMEVM5YFI2KZSNE5OQCDependencies
- [2]
6DSWVNSYLaunch single-thread executor on own thread - [3]
HKSQO7JZEnable hyper http server and configuration - [4]
FVVPKFTLInitial commit
Change contents
- file addition: xmpp.rs[3.6]
use tokio::prelude::future;pub fn xmpp_process<F>(signal: F) -> impl future::Future<Item = (), Error = tokio::io::Error>whereF: 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
use tokio::prelude::future; - edit in src/main.rs at line 22
mod xmpp;use xmpp::xmpp_process; - replacement in src/main.rs at line 63
let xmpp_join = std::thread::spawn(|| -> Result<(), tokio::io::Error> {let xmpp_join = std::thread::spawn(move || -> Result<(), tokio::io::Error> { - replacement in src/main.rs at line 66
ctrt.block_on(future::ok::<_, tokio::io::Error>(()))ctrt.block_on(xmpp_process(ctrl_c.clone().map(|_| ())))