pub fn release_lock(&self, peer_id: PeerId, semaphore: &str) -> Result<(), ThrottleError> {
        let &max = self
            .semaphores
            .get(semaphore)
            .ok_or(ThrottleError::UnknownSemaphore)?;
        let mut leases = self.leases.lock().unwrap();
        leases.release_lock(peer_id, semaphore)?;
        let mut resolved_peers = Vec::new();
        leases.resolve_pending(semaphore, max, &mut resolved_peers);
        self.wakers.resolve_with(&resolved_peers, Ok(()));
        Ok(())
    }
/// Releases a lock associated with the peer. Due to the relased lock, other locks may be
/// acquired, futures may need to be woken.
Releases a lock associated with the peer. Due to the relased lock, other locks may be
acquired, futures may need to be woken.
Releases a lock associated with the peer . Due to the relased lock other locks may be acquired futures may need to be woken .
pub fn release_lock(&self, peer_id: PeerId, semaphore: &str) -> Result<(), ThrottleError> {
        let &max = self
            .semaphores
            .get(semaphore)
            .ok_or(ThrottleError::UnknownSemaphore)?;
        let mut leases = self.leases.lock().unwrap();
        leases.release_lock(peer_id, semaphore)?;
        let mut resolved_peers = Vec::new();
        leases.resolve_pending(semaphore, max, &mut resolved_peers);
        self.wakers.resolve_with(&resolved_peers, Ok(()));
        Ok(())
    }
pub fn release_lock ( & self , peer_id : PeerId , semaphore : & str ) -> Result < ( ) , ThrottleError > { let & max = self . semaphores . get ( semaphore ) . ok_or ( ThrottleError :: UnknownSemaphore ) ? ; let mut leases = self . leases . lock ( ) . unwrap ( ) ; leases . release_lock ( peer_id , semaphore ) ? ; let mut resolved_peers = Vec :: new ( ) ; leases . resolve_pending ( semaphore , max , & mut resolved_peers ) ; self . wakers . resolve_with ( & resolved_peers , Ok ( ( ) ) ) ; Ok ( ( ) ) }
Releases a lock associated with the peer.
Releases a lock associated with the peer .
&self
peer_id
PeerId
semaphore
&str
&self
peer_id
PeerId
semaphore
&str