mirror of
https://github.com/actix/actix-extras.git
synced 2025-06-26 02:19:22 +02:00
do not re-export HttpServer from server module
This commit is contained in:
@ -162,7 +162,7 @@ impl ArbiterService for ClientConnector {}
|
||||
|
||||
impl Default for ClientConnector {
|
||||
fn default() -> ClientConnector {
|
||||
let modified = Rc::new(Cell::new(false));
|
||||
let _modified = Rc::new(Cell::new(false));
|
||||
|
||||
#[cfg(all(feature="alpn"))]
|
||||
{
|
||||
@ -173,8 +173,8 @@ impl Default for ClientConnector {
|
||||
{
|
||||
let builder = TlsConnector::builder().unwrap();
|
||||
ClientConnector {
|
||||
pool: Rc::new(Pool::new(Rc::clone(&modified))),
|
||||
pool_modified: modified,
|
||||
pool: Rc::new(Pool::new(Rc::clone(&_modified))),
|
||||
pool_modified: _modified,
|
||||
connector: builder.build().unwrap(),
|
||||
conn_lifetime: Duration::from_secs(15),
|
||||
conn_keep_alive: Duration::from_secs(75),
|
||||
@ -190,8 +190,8 @@ impl Default for ClientConnector {
|
||||
}
|
||||
|
||||
#[cfg(not(any(feature="alpn", feature="tls")))]
|
||||
ClientConnector {pool: Rc::new(Pool::new(Rc::clone(&modified))),
|
||||
pool_modified: modified,
|
||||
ClientConnector {pool: Rc::new(Pool::new(Rc::clone(&_modified))),
|
||||
pool_modified: _modified,
|
||||
conn_lifetime: Duration::from_secs(15),
|
||||
conn_keep_alive: Duration::from_secs(75),
|
||||
limit: 100,
|
||||
@ -459,7 +459,7 @@ impl ClientConnector {
|
||||
let now = Instant::now();
|
||||
let mut next = None;
|
||||
|
||||
for (_, waiters) in &mut self.waiters {
|
||||
for waiters in self.waiters.values_mut() {
|
||||
let mut idx = 0;
|
||||
while idx < waiters.len() {
|
||||
if waiters[idx].wait <= now {
|
||||
|
@ -145,7 +145,6 @@ pub use httprequest::HttpRequest;
|
||||
pub use httpresponse::HttpResponse;
|
||||
pub use handler::{Either, Responder, AsyncResponder, FromRequest, FutureResponse, State};
|
||||
pub use context::HttpContext;
|
||||
pub use server::HttpServer;
|
||||
|
||||
#[doc(hidden)]
|
||||
pub mod httpcodes;
|
||||
|
@ -32,7 +32,9 @@ use httpresponse::HttpResponse;
|
||||
/// max buffer size 64k
|
||||
pub(crate) const MAX_WRITE_BUFFER_SIZE: usize = 65_536;
|
||||
|
||||
/// Create new http server with application factory
|
||||
/// Create new http server with application factory.
|
||||
///
|
||||
/// This is shortcut for `server::HttpServer::new()` method.
|
||||
///
|
||||
/// ```rust
|
||||
/// # extern crate actix;
|
||||
@ -46,7 +48,7 @@ pub(crate) const MAX_WRITE_BUFFER_SIZE: usize = 65_536;
|
||||
/// server::new(
|
||||
/// || App::new()
|
||||
/// .resource("/", |r| r.f(|_| HttpResponse::Ok())))
|
||||
/// .bind("127.0.0.1:59080").unwrap()
|
||||
/// .bind("127.0.0.1:59090").unwrap()
|
||||
/// .start();
|
||||
///
|
||||
/// # actix::Arbiter::system().do_send(actix::msgs::SystemExit(0));
|
||||
|
Reference in New Issue
Block a user