1
0
Fork 0
mirror of https://github.com/actix/actix-web.git synced 2024-11-26 11:31:09 +00:00

hide new server api

This commit is contained in:
Nikolay Kim 2018-08-23 09:39:11 -07:00
parent f39b520a2d
commit cf54be2f17
5 changed files with 23 additions and 42 deletions

View file

@ -1,6 +1,6 @@
# Changes # Changes
## [0.8.0] - 2018-08-xx ## [0.7.4] - 2018-08-xx
### Added ### Added
@ -15,6 +15,8 @@
### Changed ### Changed
* It is allowed to use function with up to 10 parameters for handler with `extractor parameters`. * It is allowed to use function with up to 10 parameters for handler with `extractor parameters`.
`Route::with_config()`/`Route::with_async_config()` always passes configuration objects as tuple
even for handler with one parameter.
* native-tls - 0.2 * native-tls - 0.2

View file

@ -1,4 +1,4 @@
## 0.8 ## 0.7.4
* `Route::with_config()`/`Route::with_async_config()` always passes configuration objects as tuple * `Route::with_config()`/`Route::with_async_config()` always passes configuration objects as tuple
even for handler with one parameter. even for handler with one parameter.

View file

@ -175,11 +175,11 @@ where
} }
/// Disable `HTTP/2` support /// Disable `HTTP/2` support
#[doc(hidden)] // #[doc(hidden)]
#[deprecated( // #[deprecated(
since = "0.7.4", // since = "0.7.4",
note = "please use acceptor service with proper ServerFlags parama" // note = "please use acceptor service with proper ServerFlags parama"
)] // )]
pub fn no_http2(mut self) -> Self { pub fn no_http2(mut self) -> Self {
self.no_http2 = true; self.no_http2 = true;
self self
@ -217,6 +217,7 @@ where
self self
} }
#[doc(hidden)]
/// Use listener for accepting incoming connection requests /// Use listener for accepting incoming connection requests
pub fn listen_with<A>(mut self, lst: net::TcpListener, acceptor: A) -> Self pub fn listen_with<A>(mut self, lst: net::TcpListener, acceptor: A) -> Self
where where
@ -234,11 +235,6 @@ where
} }
#[cfg(feature = "tls")] #[cfg(feature = "tls")]
#[doc(hidden)]
#[deprecated(
since = "0.7.4",
note = "please use `actix_web::HttpServer::listen_with()` and `actix_web::server::NativeTlsAcceptor` instead"
)]
/// Use listener for accepting incoming tls connection requests /// Use listener for accepting incoming tls connection requests
/// ///
/// HttpServer does not change any configuration for TcpListener, /// HttpServer does not change any configuration for TcpListener,
@ -250,11 +246,6 @@ where
} }
#[cfg(feature = "alpn")] #[cfg(feature = "alpn")]
#[doc(hidden)]
#[deprecated(
since = "0.7.4",
note = "please use `actix_web::HttpServer::listen_with()` and `actix_web::server::OpensslAcceptor` instead"
)]
/// Use listener for accepting incoming tls connection requests /// Use listener for accepting incoming tls connection requests
/// ///
/// This method sets alpn protocols to "h2" and "http/1.1" /// This method sets alpn protocols to "h2" and "http/1.1"
@ -274,11 +265,6 @@ where
} }
#[cfg(feature = "rust-tls")] #[cfg(feature = "rust-tls")]
#[doc(hidden)]
#[deprecated(
since = "0.7.4",
note = "please use `actix_web::HttpServer::listen_with()` and `actix_web::server::RustlsAcceptor` instead"
)]
/// Use listener for accepting incoming tls connection requests /// Use listener for accepting incoming tls connection requests
/// ///
/// This method sets alpn protocols to "h2" and "http/1.1" /// This method sets alpn protocols to "h2" and "http/1.1"
@ -313,6 +299,7 @@ where
} }
/// Start listening for incoming connections with supplied acceptor. /// Start listening for incoming connections with supplied acceptor.
#[doc(hidden)]
#[cfg_attr(feature = "cargo-clippy", allow(needless_pass_by_value))] #[cfg_attr(feature = "cargo-clippy", allow(needless_pass_by_value))]
pub fn bind_with<S, A>(mut self, addr: S, acceptor: A) -> io::Result<Self> pub fn bind_with<S, A>(mut self, addr: S, acceptor: A) -> io::Result<Self>
where where
@ -365,11 +352,6 @@ where
} }
#[cfg(feature = "tls")] #[cfg(feature = "tls")]
#[doc(hidden)]
#[deprecated(
since = "0.7.4",
note = "please use `actix_web::HttpServer::bind_with()` and `actix_web::server::NativeTlsAcceptor` instead"
)]
/// The ssl socket address to bind /// The ssl socket address to bind
/// ///
/// To bind multiple addresses this method can be called multiple times. /// To bind multiple addresses this method can be called multiple times.
@ -382,11 +364,6 @@ where
} }
#[cfg(feature = "alpn")] #[cfg(feature = "alpn")]
#[doc(hidden)]
#[deprecated(
since = "0.7.4",
note = "please use `actix_web::HttpServer::bind_with()` and `actix_web::server::OpensslAcceptor` instead"
)]
/// Start listening for incoming tls connections. /// Start listening for incoming tls connections.
/// ///
/// This method sets alpn protocols to "h2" and "http/1.1" /// This method sets alpn protocols to "h2" and "http/1.1"
@ -407,11 +384,6 @@ where
} }
#[cfg(feature = "rust-tls")] #[cfg(feature = "rust-tls")]
#[doc(hidden)]
#[deprecated(
since = "0.7.4",
note = "please use `actix_web::HttpServer::bind_with()` and `actix_web::server::RustlsAcceptor` instead"
)]
/// Start listening for incoming tls connections. /// Start listening for incoming tls connections.
/// ///
/// This method sets alpn protocols to "h2" and "http/1.1" /// This method sets alpn protocols to "h2" and "http/1.1"

View file

@ -137,11 +137,15 @@ mod worker;
use actix::Message; use actix::Message;
pub use self::message::Request; pub use self::message::Request;
#[doc(hidden)]
pub use self::server::{ pub use self::server::{
ConnectionRateTag, ConnectionTag, Connections, Server, Service, ServiceHandler, ConnectionRateTag, ConnectionTag, Connections, Server, Service, ServiceHandler,
}; };
pub use self::settings::ServerSettings; pub use self::settings::ServerSettings;
pub use self::http::HttpServer; pub use self::http::HttpServer;
#[doc(hidden)]
pub use self::ssl::*; pub use self::ssl::*;
#[doc(hidden)] #[doc(hidden)]

View file

@ -13,8 +13,9 @@ use super::accept::{AcceptLoop, AcceptNotify, Command};
use super::worker::{StopWorker, Worker, WorkerClient, Conn}; use super::worker::{StopWorker, Worker, WorkerClient, Conn};
use super::{PauseServer, ResumeServer, StopServer, Token}; use super::{PauseServer, ResumeServer, StopServer, Token};
///Describes service that could be used #[doc(hidden)]
///with [Server](struct.Server.html) /// Describes service that could be used
/// with [Server](struct.Server.html)
pub trait Service: Send + 'static { pub trait Service: Send + 'static {
/// Clone service /// Clone service
fn clone(&self) -> Box<Service>; fn clone(&self) -> Box<Service>;
@ -33,8 +34,9 @@ impl Service for Box<Service> {
} }
} }
///Describes the way serivce handles incoming #[doc(hidden)]
///TCP connections. /// Describes the way serivce handles incoming
/// TCP connections.
pub trait ServiceHandler { pub trait ServiceHandler {
/// Handle incoming stream /// Handle incoming stream
fn handle(&mut self, token: Token, io: net::TcpStream, peer: Option<net::SocketAddr>); fn handle(&mut self, token: Token, io: net::TcpStream, peer: Option<net::SocketAddr>);
@ -47,7 +49,8 @@ pub(crate) enum ServerCommand {
WorkerDied(usize), WorkerDied(usize),
} }
///Server /// Generic server
#[doc(hidden)]
pub struct Server { pub struct Server {
threads: usize, threads: usize,
workers: Vec<(usize, Addr<Worker>)>, workers: Vec<(usize, Addr<Worker>)>,