pub fn try_send(&self, value: V) -> Result<(), TrySendError<V>> {
        match self.queue.produce(value) {
            Err(ProduceError::Disconnected(v)) => return Err(TrySendError::Disconnected(v)),
            Err(ProduceError::Full(v)) => return Err(TrySendError::Full(v)),
            Ok(_) => {
                self.len.fetch_add(1, Ordering::SeqCst);
            }
        }
        let task_l = self.task.read().expect("Can't lock task!");
        if let Some(task) = task_l.as_ref() {
            task.notify();
        }
        Ok(())
    }
/// Try sending a new job
/// Doesn't block in best-normal case, but can block for a guaranteed short amount.
Try sending a new job
Doesn't block in best-normal case, but can block for a guaranteed short amount.
Try sending a new job Doesn ' t block in best - normal case but can block for a guaranteed short amount .
pub fn try_send(&self, value: V) -> Result<(), TrySendError<V>> {
        match self.queue.produce(value) {
            Err(ProduceError::Disconnected(v)) => return Err(TrySendError::Disconnected(v)),
            Err(ProduceError::Full(v)) => return Err(TrySendError::Full(v)),
            Ok(_) => {
                self.len.fetch_add(1, Ordering::SeqCst);
            }
        }
        let task_l = self.task.read().expect("Can't lock task!");
        if let Some(task) = task_l.as_ref() {
            task.notify();
        }
        Ok(())
    }
pub fn try_send ( & self , value : V ) -> Result < ( ) , TrySendError < V > > { match self . queue . produce ( value ) { Err ( ProduceError :: Disconnected ( v ) ) => return Err ( TrySendError :: Disconnected ( v ) ) , Err ( ProduceError :: Full ( v ) ) => return Err ( TrySendError :: Full ( v ) ) , Ok ( _ ) => { self . len . fetch_add ( 1 , Ordering :: SeqCst ) ; } } let task_l = self . task . read ( ) . expect ( " " ) ; if let Some ( task ) = task_l . as_ref ( ) { task . notify ( ) ; } Ok ( ( ) ) }
Try sending a new job
Doesn't block in best-normal case, but can block for a guaranteed short amount.
Try sending a new job Doesn ' t block in best - normal case but can block for a guaranteed short amount .
&self
value
V
&self
value
V