mirror of
https://github.com/actix/actix-extras.git
synced 2025-01-22 23:05:56 +01:00
use std mutext instead of parking_lot
This commit is contained in:
parent
5132257b0d
commit
ef3a33b9d6
@ -88,7 +88,6 @@ fxhash = "0.2.1"
|
|||||||
log = "0.4"
|
log = "0.4"
|
||||||
mime = "0.3"
|
mime = "0.3"
|
||||||
net2 = "0.2.33"
|
net2 = "0.2.33"
|
||||||
parking_lot = "0.9"
|
|
||||||
pin-project = "0.4.6"
|
pin-project = "0.4.6"
|
||||||
regex = "1.3"
|
regex = "1.3"
|
||||||
serde = { version = "1.0", features=["derive"] }
|
serde = { version = "1.0", features=["derive"] }
|
||||||
@ -126,4 +125,4 @@ actix-identity = { path = "actix-identity" }
|
|||||||
actix-session = { path = "actix-session" }
|
actix-session = { path = "actix-session" }
|
||||||
actix-files = { path = "actix-files" }
|
actix-files = { path = "actix-files" }
|
||||||
actix-multipart = { path = "actix-multipart" }
|
actix-multipart = { path = "actix-multipart" }
|
||||||
awc = { path = "awc" }
|
awc = { path = "awc" }
|
@ -1,5 +1,5 @@
|
|||||||
use std::marker::PhantomData;
|
use std::marker::PhantomData;
|
||||||
use std::sync::Arc;
|
use std::sync::{Arc, Mutex};
|
||||||
use std::{fmt, io, net};
|
use std::{fmt, io, net};
|
||||||
|
|
||||||
use actix_http::{
|
use actix_http::{
|
||||||
@ -8,7 +8,6 @@ use actix_http::{
|
|||||||
use actix_server::{Server, ServerBuilder};
|
use actix_server::{Server, ServerBuilder};
|
||||||
use actix_service::{pipeline_factory, IntoServiceFactory, Service, ServiceFactory};
|
use actix_service::{pipeline_factory, IntoServiceFactory, Service, ServiceFactory};
|
||||||
use futures::future::ok;
|
use futures::future::ok;
|
||||||
use parking_lot::Mutex;
|
|
||||||
|
|
||||||
use net2::TcpBuilder;
|
use net2::TcpBuilder;
|
||||||
|
|
||||||
@ -147,7 +146,7 @@ where
|
|||||||
///
|
///
|
||||||
/// By default keep alive is set to a 5 seconds.
|
/// By default keep alive is set to a 5 seconds.
|
||||||
pub fn keep_alive<T: Into<KeepAlive>>(self, val: T) -> Self {
|
pub fn keep_alive<T: Into<KeepAlive>>(self, val: T) -> Self {
|
||||||
self.config.lock().keep_alive = val.into();
|
self.config.lock().unwrap().keep_alive = val.into();
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -161,7 +160,7 @@ where
|
|||||||
///
|
///
|
||||||
/// By default client timeout is set to 5000 milliseconds.
|
/// By default client timeout is set to 5000 milliseconds.
|
||||||
pub fn client_timeout(self, val: u64) -> Self {
|
pub fn client_timeout(self, val: u64) -> Self {
|
||||||
self.config.lock().client_timeout = val;
|
self.config.lock().unwrap().client_timeout = val;
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -174,7 +173,7 @@ where
|
|||||||
///
|
///
|
||||||
/// By default client timeout is set to 5000 milliseconds.
|
/// By default client timeout is set to 5000 milliseconds.
|
||||||
pub fn client_shutdown(self, val: u64) -> Self {
|
pub fn client_shutdown(self, val: u64) -> Self {
|
||||||
self.config.lock().client_shutdown = val;
|
self.config.lock().unwrap().client_shutdown = val;
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -246,7 +245,7 @@ where
|
|||||||
format!("actix-web-service-{}", addr),
|
format!("actix-web-service-{}", addr),
|
||||||
lst,
|
lst,
|
||||||
move || {
|
move || {
|
||||||
let c = cfg.lock();
|
let c = cfg.lock().unwrap();
|
||||||
HttpService::build()
|
HttpService::build()
|
||||||
.keep_alive(c.keep_alive)
|
.keep_alive(c.keep_alive)
|
||||||
.client_timeout(c.client_timeout)
|
.client_timeout(c.client_timeout)
|
||||||
@ -288,7 +287,7 @@ where
|
|||||||
format!("actix-web-service-{}", addr),
|
format!("actix-web-service-{}", addr),
|
||||||
lst,
|
lst,
|
||||||
move || {
|
move || {
|
||||||
let c = cfg.lock();
|
let c = cfg.lock().unwrap();
|
||||||
HttpService::build()
|
HttpService::build()
|
||||||
.keep_alive(c.keep_alive)
|
.keep_alive(c.keep_alive)
|
||||||
.client_timeout(c.client_timeout)
|
.client_timeout(c.client_timeout)
|
||||||
@ -330,7 +329,7 @@ where
|
|||||||
format!("actix-web-service-{}", addr),
|
format!("actix-web-service-{}", addr),
|
||||||
lst,
|
lst,
|
||||||
move || {
|
move || {
|
||||||
let c = cfg.lock();
|
let c = cfg.lock().unwrap();
|
||||||
HttpService::build()
|
HttpService::build()
|
||||||
.keep_alive(c.keep_alive)
|
.keep_alive(c.keep_alive)
|
||||||
.client_timeout(c.client_timeout)
|
.client_timeout(c.client_timeout)
|
||||||
@ -448,7 +447,7 @@ where
|
|||||||
let addr = format!("actix-web-service-{:?}", lst.local_addr()?);
|
let addr = format!("actix-web-service-{:?}", lst.local_addr()?);
|
||||||
|
|
||||||
self.builder = self.builder.listen_uds(addr, lst, move || {
|
self.builder = self.builder.listen_uds(addr, lst, move || {
|
||||||
let c = cfg.lock();
|
let c = cfg.lock().unwrap();
|
||||||
pipeline_factory(|io: UnixStream| ok((io, Protocol::Http1, None))).and_then(
|
pipeline_factory(|io: UnixStream| ok((io, Protocol::Http1, None))).and_then(
|
||||||
HttpService::build()
|
HttpService::build()
|
||||||
.keep_alive(c.keep_alive)
|
.keep_alive(c.keep_alive)
|
||||||
@ -483,7 +482,7 @@ where
|
|||||||
format!("actix-web-service-{:?}", addr.as_ref()),
|
format!("actix-web-service-{:?}", addr.as_ref()),
|
||||||
addr,
|
addr,
|
||||||
move || {
|
move || {
|
||||||
let c = cfg.lock();
|
let c = cfg.lock().unwrap();
|
||||||
pipeline_factory(|io: UnixStream| ok((io, Protocol::Http1, None)))
|
pipeline_factory(|io: UnixStream| ok((io, Protocol::Http1, None)))
|
||||||
.and_then(
|
.and_then(
|
||||||
HttpService::build()
|
HttpService::build()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user