7OTSYQ4Z34N5AOSBCMN63M7WA4DYKFAY5B7SB25BG3IHE6FCUKLAC
}).and_then(|opt_cmd_recv: Option<Receiver<XmppCommand>>| {
if let Some(mut cmd_recv) = opt_cmd_recv {
// process left commands
info!("Stop accepting commands");
cmd_recv.close();
Box::new(cmd_recv.for_each(|_cmd| future::ok(())).map_err(|_| {
tokio::io::Error::new(tokio::io::ErrorKind::Other, "cmd receiver last error")
})) as Box<Future<Item = (), Error = tokio::io::Error>>
} else {
Box::new(future::err(tokio::io::Error::new(
tokio::io::ErrorKind::Other,
"cmd receiver gone",
)))
}