/// Connects to a redis-server in sentinel mode (used in redis clusters) and
/// return a client pointing to the current master.
/// This opens a short-lived connection to the sentinal server but does not open
/// yet a connection to the master.
/// https://github.com/mitsuhiko/redis-rs/pull/199
Connects to a redis-server in sentinel mode (used in redis clusters) and
return a client pointing to the current master.
This opens a short-lived connection to the sentinal server but does not open
yet a connection to the master.
Connects to a redis - server in sentinel mode ( used in redis clusters ) and return a client pointing to the current master . This opens a short - lived connection to the sentinal server but does not open yet a connection to the master .
pub fn open_with_sentinel<T: IntoConnectionInfo>(
         master_group_name: &str,
         params: T,
    ) -> RedisResult<Client> {
        let connection_info = params.into_connection_info()?;
        let mut sentinel_client = Client {
            connection_info: connection_info.clone(),
        };
        let (master_addr, master_port): (String, u16) = crate::cmd("SENTINEL")
            .arg("get-master-addr-by-name")
            .arg(master_group_name)
            .query(&mut sentinel_client)?;
        Ok(Client {
            connection_info: ConnectionInfo {
                addr: Box::new(ConnectionAddr::Tcp(master_addr, master_port)),
                ..connection_info
            },
        })
    }
pub fn open_with_sentinel < T : IntoConnectionInfo > ( master_group_name : & str , params : T , ) -> RedisResult < Client > { let connection_info = params . into_connection_info ( ) ? ; let mut sentinel_client = Client { connection_info : connection_info . clone ( ) , } ; let ( master_addr , master_port ) : ( String , u16 ) = crate :: cmd ( " " ) . arg ( " " ) . arg ( master_group_name ) . query ( & mut sentinel_client ) ? ; Ok ( Client { connection_info : ConnectionInfo { addr : Box :: new ( ConnectionAddr :: Tcp ( master_addr , master_port ) ) , .. connection_info } , } ) }
Connects to a redis-server in sentinel mode (used in redis clusters) and
return a client pointing to the current master.
Connects to a redis - server in sentinel mode ( used in redis clusters ) and return a client pointing to the current master .
master_group_name
&str
params
T