From ea1dccff599f0fb8597f0eb0db74b6b71ad21407 Mon Sep 17 00:00:00 2001 From: Jonathan Giddy Date: Sun, 31 Jul 2016 17:18:45 +0100 Subject: [PATCH] docs(guide): fix guide example to save receiver for later use by response handler --- doc/guide/server.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/doc/guide/server.md b/doc/guide/server.md index 96c70040..15658a6c 100644 --- a/doc/guide/server.md +++ b/doc/guide/server.md @@ -314,7 +314,9 @@ impl Handler 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(); }