pub fn poll_once(&self) -> Result<(), RegistryClientError> {
        let (records, version) = {
            let latest_version = self.cache.read().unwrap().latest_version;
            match self
                .data_provider
                .get_updates_since(latest_version)
            {
                Ok((records, version)) if version > latest_version => {
                    (records, version)
                }
                Ok(_) /*if version == cache_state.latest_version*/ => return Ok(()),
                Err(e) => return Err(RegistryClientError::from(e)),
            }
        };

        // Ensure exclusive access to the cache.
        let mut cache_state = self.cache.write().unwrap();

        // Check version again under write lock, to prevent race conditions.
        if version > cache_state.latest_version {
            self.metrics
                .ic_registry_client_registry_version
                .set(version.get() as i64);
            cache_state.update(records, version);
        }
        Ok(())
    }
/// Fetches the newest updates from the registry data provider.
///
/// Returns an error if a poll is already in progress or querying the data
/// provider failed. Returns `Ok` if querying the data provider succeeded,
/// regardless of whether a newer registry version was available or not.
Fetches the newest updates from the registry data provider.
Returns an error if a poll is already in progress or querying the data
provider failed. Returns `Ok` if querying the data provider succeeded,
regardless of whether a newer registry version was available or not.
Fetches the newest updates from the registry data provider . Returns an error if a poll is already in progress or querying the data provider failed . Returns ` Ok ` if querying the data provider succeeded regardless of whether a newer registry version was available or not .
pub fn poll_once(&self) -> Result<(), RegistryClientError> {
        let (records, version) = {
            let latest_version = self.cache.read().unwrap().latest_version;
            match self
                .data_provider
                .get_updates_since(latest_version)
            {
                Ok((records, version)) if version > latest_version => {
                    (records, version)
                }
                Ok(_) /*if version == cache_state.latest_version*/ => return Ok(()),
                Err(e) => return Err(RegistryClientError::from(e)),
            }
        };
        // Ensure exclusive access to the cache.
        let mut cache_state = self.cache.write().unwrap();
        // Check version again under write lock, to prevent race conditions.
        if version > cache_state.latest_version {
            self.metrics
                .ic_registry_client_registry_version
                .set(version.get() as i64);
            cache_state.update(records, version);
        }
        Ok(())
    }
pub fn poll_once ( & self ) -> Result < ( ) , RegistryClientError > { let ( records , version ) = { let latest_version = self . cache . read ( ) . unwrap ( ) . latest_version ; match self . data_provider . get_updates_since ( latest_version ) { Ok ( ( records , version ) ) if version > latest_version => { ( records , version ) } Ok ( _ ) /*if version == cache_state.latest_version*/ => return Ok ( ( ) ) , Err ( e ) => return Err ( RegistryClientError :: from ( e ) ) , } } ; // Ensure exclusive access to the cache. let mut cache_state = self . cache . write ( ) . unwrap ( ) ; // Check version again under write lock, to prevent race conditions. if version > cache_state . latest_version { self . metrics . ic_registry_client_registry_version . set ( version . get ( ) as i64 ) ; cache_state . update ( records , version ) ; } Ok ( ( ) ) }
Fetches the newest updates from the registry data provider.
Fetches the newest updates from the registry data provider .
&self
&self