docs(guide): fix guide example to save receiver for later use by response handler

This commit is contained in:
Jonathan Giddy
2016-07-31 17:18:45 +01:00
parent 81e7bf4155
commit ea1dccff59

View File

@@ -314,7 +314,9 @@ impl Handler<Http> for Text {
"/question" => {
let (tx, rx) = mpsc::channel();
// queue work on our worker
self.worker_tx.send((self.control.take().unwrap(), tx));
self.worker_tx.send((self.control.take().unwrap(), tx)).unwrap();
// save receive channel for response handling
self.worker_rx = Some(rx);
// tell hyper we need to wait until we can continue
return Next::wait();
}