feat(server): change default dispatcher

- Deprecates the `no_proto` configuration on `Server`. It is always
  enabled.
- Deprecates all pieces related to tokio-proto.
- Makes the tokio-proto crate optional, and the `server-proto` feature
  can be used to completely remove the dependency. It is enabled by
  default.
This commit is contained in:
Sean McArthur
2017-12-28 18:56:15 -08:00
parent 0892cb2777
commit 6ade21aa7f
15 changed files with 124 additions and 118 deletions

View File

@@ -19,8 +19,7 @@ fn main() {
.with_body(PHRASE))
}));
let mut server = Http::new().bind(&addr, new_service).unwrap();
server.no_proto();
let server = Http::new().bind(&addr, new_service).unwrap();
println!("Listening on http://{} with 1 thread.", server.local_addr().unwrap());
server.run().unwrap();
}

View File

@@ -99,8 +99,7 @@ fn main() {
pretty_env_logger::init().unwrap();
let addr = "127.0.0.1:1337".parse().unwrap();
let mut server = Http::new().bind(&addr, || Ok(ParamExample)).unwrap();
server.no_proto();
let server = Http::new().bind(&addr, || Ok(ParamExample)).unwrap();
println!("Listening on http://{} with 1 thread.", server.local_addr().unwrap());
server.run().unwrap();
}

View File

@@ -135,8 +135,7 @@ fn main() {
pretty_env_logger::init().unwrap();
let addr = "127.0.0.1:1337".parse().unwrap();
let mut server = Http::new().bind(&addr, || Ok(ResponseExamples)).unwrap();
server.no_proto();
let server = Http::new().bind(&addr, || Ok(ResponseExamples)).unwrap();
println!("Listening on http://{} with 1 thread.", server.local_addr().unwrap());
server.run().unwrap();
}

View File

@@ -47,8 +47,7 @@ fn main() {
pretty_env_logger::init().unwrap();
let addr = "127.0.0.1:1337".parse().unwrap();
let mut server = Http::new().bind(&addr, || Ok(Echo)).unwrap();
server.no_proto();
let server = Http::new().bind(&addr, || Ok(Echo)).unwrap();
println!("Listening on http://{} with 1 thread.", server.local_addr().unwrap());
server.run().unwrap();
}