pub async fn wait_for_resolving(&self, peer_id: u64) -> Result<(), ThrottleError> {
        let strong = Arc::new(Mutex::new(Shared {
            result: None,
            waker: None,
        }));
        let weak = Arc::downgrade(&strong);
        {
            let mut wakers = self.wakers.lock().unwrap();
            wakers.retain(|(_peer, r)| r.strong_count() != 0);
            wakers.push((peer_id, weak));
        }
        FutureAcquired { shared: strong }.await
    }
/// A future associated with a peer, which can be resolved using `resolve_with`.
///
/// Attention: Do not call this method while holding a lock to `leases`.
A future associated with a peer, which can be resolved using `resolve_with`.
Attention: Do not call this method while holding a lock to `leases`.
A future associated with a peer which can be resolved using ` resolve_with ` . Attention : Do not call this method while holding a lock to ` leases ` .
pub async fn wait_for_resolving(&self, peer_id: u64) -> Result<(), ThrottleError> {
        let strong = Arc::new(Mutex::new(Shared {
            result: None,
            waker: None,
        }));
        let weak = Arc::downgrade(&strong);
        {
            let mut wakers = self.wakers.lock().unwrap();
            wakers.retain(|(_peer, r)| r.strong_count() != 0);
            wakers.push((peer_id, weak));
        }
        FutureAcquired { shared: strong }.await
    }
pub async fn wait_for_resolving ( & self , peer_id : u64 ) -> Result < ( ) , ThrottleError > { let strong = Arc :: new ( Mutex :: new ( Shared { result : None , waker : None , } ) ) ; let weak = Arc :: downgrade ( & strong ) ; { let mut wakers = self . wakers . lock ( ) . unwrap ( ) ; wakers . retain ( | ( _peer , r ) | r . strong_count ( ) != 0 ) ; wakers . push ( ( peer_id , weak ) ) ; } FutureAcquired { shared : strong } . await }
A future associated with a peer, which can be resolved using `resolve_with`.
A future associated with a peer which can be resolved using ` resolve_with ` .
&self
peer_id
u64
&self
peer_id
u64