Split response future from client::Stream (#153)
This commit is contained in:
@@ -75,9 +75,9 @@ pub fn main() {
|
||||
.body(())
|
||||
.unwrap();
|
||||
|
||||
let stream = client.send_request(request, true).unwrap();
|
||||
let (response, _) = client.send_request(request, true).unwrap();
|
||||
|
||||
let stream = stream.and_then(|response| {
|
||||
let stream = response.and_then(|response| {
|
||||
let (_, body) = response.into_parts();
|
||||
|
||||
body.for_each(|chunk| {
|
||||
|
||||
@@ -70,7 +70,7 @@ pub fn main() {
|
||||
let mut trailers = HeaderMap::new();
|
||||
trailers.insert("zomg", "hello".parse().unwrap());
|
||||
|
||||
let mut stream = client.send_request(request, false).unwrap();
|
||||
let (response, mut stream) = client.send_request(request, false).unwrap();
|
||||
|
||||
// send trailers
|
||||
stream.send_trailers(trailers).unwrap();
|
||||
@@ -78,7 +78,7 @@ pub fn main() {
|
||||
// Spawn a task to run the conn...
|
||||
handle.spawn(h2.map_err(|e| println!("GOT ERR={:?}", e)));
|
||||
|
||||
stream
|
||||
response
|
||||
.and_then(|response| {
|
||||
println!("GOT RESPONSE: {:?}", response);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user