pub struct ConPool { /* private fields */ }Available on crate features
web_server and con_pool only.Expand description
manage a pool of Connections to an Server.
Implementations§
Source§impl ConPool
impl ConPool
Sourcepub async fn new(sock_addr: &Addr) -> Result<ConPool, Box<dyn Error>>
pub async fn new(sock_addr: &Addr) -> Result<ConPool, Box<dyn Error>>
Connect to a FCGI server / application with MultiHeaderStrategy::OnlyFirst & HeaderMultilineStrategy::Ignore.
See ConPool::new_with_strategy
Sourcepub async fn new_with_strategy(
sock_addr: &Addr,
header_mul: MultiHeaderStrategy,
header_nl: HeaderMultilineStrategy,
) -> Result<ConPool, Box<dyn Error>>
pub async fn new_with_strategy( sock_addr: &Addr, header_mul: MultiHeaderStrategy, header_nl: HeaderMultilineStrategy, ) -> Result<ConPool, Box<dyn Error>>
Connect to a FCGI server / application.
Queries MAX_CONNS,
MAX_REQS
and MPXS_CONNS from the server
and uses the values to create a Connection.
Source§impl ConPool
impl ConPool
Sourcepub async fn prep_server<S>(
program: S,
sock_addr: &Addr,
) -> Result<Command, IoError>
Available on crate feature app_start only.
pub async fn prep_server<S>( program: S, sock_addr: &Addr, ) -> Result<Command, IoError>
app_start only.Setup a Command to spin up a FCGI server / application
and make it listen on sock_addr.
let mut env = HashMap::new();
env.insert("PHP_FCGI_CHILDREN", "16");
env.insert("PHP_FCGI_MAX_REQUESTS", "10000");
let addr: FCGIAddr = "127.0.0.1:1236".parse()?;
let php = ConPool::prep_server("/usr/bin/php-cgi7.4", &addr)
.await?
.env_clear().envs(env)
.spawn()?;Trait Implementations§
Auto Trait Implementations§
impl Freeze for ConPool
impl !RefUnwindSafe for ConPool
impl Send for ConPool
impl Sync for ConPool
impl Unpin for ConPool
impl !UnwindSafe for ConPool
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more