Start switching net/ to use abstractions over channels to allow introducing non-channel communication in the future.

This commit is contained in:
Josh Matthews 2015-01-25 10:44:28 -05:00
parent 7fddf4aa13
commit 1644436557
13 changed files with 108 additions and 79 deletions

View file

@ -4,6 +4,7 @@
extern crate hyper;
use net_traits::ResponseSenders::Channel;
use net_traits::LoadData;
use net_traits::ProgressMsg::{Payload, Done};
use self::hyper::header::ContentType;
@ -19,7 +20,7 @@ fn assert_parse(url: &'static str,
use net::data_loader::load;
let (start_chan, start_port) = channel();
load(LoadData::new(Url::parse(url).unwrap(), start_chan));
load(LoadData::new(Url::parse(url).unwrap()), Channel(start_chan));
let response = start_port.recv().unwrap();
assert_eq!(&response.metadata.content_type, &content_type);