mirror of
https://github.com/actix/actix-extras.git
synced 2025-06-29 19:24:58 +02:00
simplify http response pool
This commit is contained in:
@ -42,7 +42,7 @@ pub struct ServerSettings {
|
||||
secure: bool,
|
||||
host: String,
|
||||
cpu_pool: UnsafeCell<Option<CpuPool>>,
|
||||
responses: Rc<UnsafeCell<HttpResponsePool>>,
|
||||
responses: &'static HttpResponsePool,
|
||||
}
|
||||
|
||||
impl Clone for ServerSettings {
|
||||
@ -52,7 +52,7 @@ impl Clone for ServerSettings {
|
||||
secure: self.secure,
|
||||
host: self.host.clone(),
|
||||
cpu_pool: UnsafeCell::new(None),
|
||||
responses: HttpResponsePool::pool(),
|
||||
responses: HttpResponsePool::get_pool(),
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -63,7 +63,7 @@ impl Default for ServerSettings {
|
||||
addr: None,
|
||||
secure: false,
|
||||
host: "localhost:8080".to_owned(),
|
||||
responses: HttpResponsePool::pool(),
|
||||
responses: HttpResponsePool::get_pool(),
|
||||
cpu_pool: UnsafeCell::new(None),
|
||||
}
|
||||
}
|
||||
@ -82,7 +82,7 @@ impl ServerSettings {
|
||||
"localhost".to_owned()
|
||||
};
|
||||
let cpu_pool = UnsafeCell::new(None);
|
||||
let responses = HttpResponsePool::pool();
|
||||
let responses = HttpResponsePool::get_pool();
|
||||
ServerSettings {
|
||||
addr,
|
||||
secure,
|
||||
@ -103,7 +103,7 @@ impl ServerSettings {
|
||||
host,
|
||||
secure,
|
||||
cpu_pool: UnsafeCell::new(None),
|
||||
responses: HttpResponsePool::pool(),
|
||||
responses: HttpResponsePool::get_pool(),
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user