fn receive(&self, cmd: P) {
        if let Some(ref mut mutex) = self.try_lock() {
            (*mutex).receive(cmd);
        } else {
            log::warn!("try_lock failed for receive, retrying");
            let backoff = Backoff::new();
            loop {
                if let Some(ref mut mutex) = self.try_lock() {
                    (*mutex).receive(cmd);
                    return;
                } else if backoff.is_completed() {
                    log::error!("try_lock failed for receive, giving up after multiple retries");
                    return;
                } else {
                    backoff.snooze();
                }
            }
        }
    }
// In order to prevent lockup of an executor, a try_lock is attempted, while
// it should always obtain the lock, there may be data-races where it can't.
// In those rare cases, a warning is logged and backoff is used. Eventually,
// it will give up and re-schedule. This same approach is used for the disconnected()
// and connected() methods.
In order to prevent lockup of an executor, a try_lock is attempted, while
it should always obtain the lock, there may be data-races where it can't.
In those rare cases, a warning is logged and backoff is used. Eventually,
it will give up and re-schedule. This same approach is used for the disconnected()
and connected() methods.
In order to prevent lockup of an executor a try_lock is attempted while it should always obtain the lock there may be data - races where it can ' t . In those rare cases a warning is logged and backoff is used . Eventually it will give up and re - schedule . This same approach is used for the disconnected () and connected () methods .
fn receive(&self, cmd: P) {
        if let Some(ref mut mutex) = self.try_lock() {
            (*mutex).receive(cmd);
        } else {
            log::warn!("try_lock failed for receive, retrying");
            let backoff = Backoff::new();
            loop {
                if let Some(ref mut mutex) = self.try_lock() {
                    (*mutex).receive(cmd);
                    return;
                } else if backoff.is_completed() {
                    log::error!("try_lock failed for receive, giving up after multiple retries");
                    return;
                } else {
                    backoff.snooze();
                }
            }
        }
    }
fn receive ( & self , cmd : P ) { if let Some ( ref mut mutex ) = self . try_lock ( ) { ( * mutex ) . receive ( cmd ) ; } else { log :: warn ! ( " " ) ; let backoff = Backoff :: new ( ) ; loop { if let Some ( ref mut mutex ) = self . try_lock ( ) { ( * mutex ) . receive ( cmd ) ; return ; } else if backoff . is_completed ( ) { log :: error ! ( " " ) ; return ; } else { backoff . snooze ( ) ; } } } }
In order to prevent lockup of an executor, a try_lock is attempted, while
it should always obtain the lock, there may be data-races where it can't.
In order to prevent lockup of an executor a try_lock is attempted while it should always obtain the lock there may be data - races where it can ' t .
&self
cmd
P