///Create a new, owned connection using the settings of the current pool. Useful for subscribers or blocking operations that may not yield a value for a long time.
Create a new, owned connection using the settings of the current pool. Useful for subscribers or blocking operations that may not yield a value for a long time.
Create a new owned connection using the settings of the current pool . Useful for subscribers or blocking operations that may not yield a value for a long time .
pub async fn spawn<'a, N>(&'a self, name: N) -> Result<Connection>
    where
        N: Into<Option<&'a str>>,
    {
        let mut out = if let Some(p) = &self.password {
            Connection::connect_and_auth(self.address.as_ref(), p.as_bytes()).await?
        } else {
            Connection::connect(self.address.as_ref()).await?
        };
        let name = name.into().unwrap_or("spawned_connection");
        let name = format!("{}-{}", self.name, name);
        let command = Command::new("CLIENT").arg(&"SETNAME").arg(&name);
        out.run_command(command).await?;
        Ok(out)
    }
pub async fn spawn < ' a , N > ( & ' a self , name : N ) -> Result < Connection > where N : Into < Option < & ' a str > > , { let mut out = if let Some ( p ) = & self . password { Connection :: connect_and_auth ( self . address . as_ref ( ) , p . as_bytes ( ) ) . await ? } else { Connection :: connect ( self . address . as_ref ( ) ) . await ? } ; let name = name . into ( ) . unwrap_or ( " " ) ; let name = format ! ( " " self name name ) ; let command = Command :: new ( " " ) . arg ( & " " ) . arg ( & name ) ; out . run_command ( command ) . await ? ; Ok ( out ) }
Create a new, owned connection using the settings of the current pool.
Create a new owned connection using the settings of the current pool .
&'a self
name
N