pub fn fetch_and_start_polling(&self) -> Result<(), RegistryClientError> {
        if self
            .started
            .compare_and_swap(false, true, Ordering::Relaxed)
        {
            return Err(RegistryClientError::PollLockFailed {
                error: "'fetch_and_start_polling' already called".to_string(),
            });
        }
        self.poll_once()?;
        let cancelled = Arc::clone(&self.cancelled);
        let self_ = self.clone();
        tokio::spawn(async move {
            while !cancelled.load(Ordering::Relaxed) {
                tokio::time::delay_for(POLLING_PERIOD).await;
                if let Ok(()) = self_.poll_once() {}
            }
        });

        Ok(())
    }
/// Calls `poll_once()` synchronously, if it succeeds a background task is
/// spawned that continuously polls for updates.
/// The background task is stopped when the object is dropped.
Calls `poll_once()` synchronously, if it succeeds a background task is
spawned that continuously polls for updates.
The background task is stopped when the object is dropped.
Calls ` poll_once () ` synchronously if it succeeds a background task is spawned that continuously polls for updates . The background task is stopped when the object is dropped .
pub fn fetch_and_start_polling(&self) -> Result<(), RegistryClientError> {
        if self
            .started
            .compare_and_swap(false, true, Ordering::Relaxed)
        {
            return Err(RegistryClientError::PollLockFailed {
                error: "'fetch_and_start_polling' already called".to_string(),
            });
        }
        self.poll_once()?;
        let cancelled = Arc::clone(&self.cancelled);
        let self_ = self.clone();
        tokio::spawn(async move {
            while !cancelled.load(Ordering::Relaxed) {
                tokio::time::delay_for(POLLING_PERIOD).await;
                if let Ok(()) = self_.poll_once() {}
            }
        });
        Ok(())
    }
pub fn fetch_and_start_polling ( & self ) -> Result < ( ) , RegistryClientError > { if self . started . compare_and_swap ( false , true , Ordering :: Relaxed ) { return Err ( RegistryClientError :: PollLockFailed { error : " " . to_string ( ) , } ) ; } self . poll_once ( ) ? ; let cancelled = Arc :: clone ( & self . cancelled ) ; let self_ = self . clone ( ) ; tokio :: spawn ( async move { while ! cancelled . load ( Ordering :: Relaxed ) { tokio :: time :: delay_for ( POLLING_PERIOD ) . await ; if let Ok ( ( ) ) = self_ . poll_once ( ) { } } } ) ; Ok ( ( ) ) }
Calls `poll_once()` synchronously, if it succeeds a background task is
spawned that continuously polls for updates.
Calls ` poll_once () ` synchronously if it succeeds a background task is spawned that continuously polls for updates .
&self
&self