/// send request message to specific spu
/// this is a one way send
send request message to specific spu
this is a one way send
send request message to specific spu this is a one way send
async fn send_msg<'a, R>(
        &'a self,
        spu_id: &'a SpuId,
        req_msg: &'a RequestMessage<R>,
    ) -> Result<bool, ScServerError>
    where
        R: Request + Send + Sync + 'static,
    {
        if let Some(mut spu_conn) = self.get_mut_connection(spu_id) {
            // send message & evaluate response
            trace!("spu client: sending msg: {:#?}", req_msg);
            match spu_conn.send_request(&req_msg).await {
                Ok(_) => {
                    trace!("spu client send successfully");
                    // increment ok counter
                    self.inc_ok_counter(spu_id);
                    Ok(true)
                }
                Err(err) => {
                    error!("spu client send failed");
                    // mark socket as stale and update counter
                    //spu_conn.set_stale();
                    self.inc_failed_counter(spu_id);
                    Err(ScServerError::SpuCommuncationError(*spu_id, err))
                }
            }
        } else {
            Ok(false)
        }
    }
async fn send_msg < ' a , R > ( & ' a self , spu_id : & ' a SpuId , req_msg : & ' a RequestMessage < R > , ) -> Result < bool , ScServerError > where R : Request + Send + Sync + ' static , { if let Some ( mut spu_conn ) = self . get_mut_connection ( spu_id ) { // send message & evaluate response trace ! ( " " req_msg ) ; match spu_conn . send_request ( & req_msg ) . await { Ok ( _ ) => { trace ! ( " " ) ; // increment ok counter self . inc_ok_counter ( spu_id ) ; Ok ( true ) } Err ( err ) => { error ! ( " " ) ; // mark socket as stale and update counter //spu_conn.set_stale(); self . inc_failed_counter ( spu_id ) ; Err ( ScServerError :: SpuCommuncationError ( * spu_id , err ) ) } } } else { Ok ( false ) } }
send request message to specific spu
this is a one way send
send request message to specific spu this is a one way send
&'a self
spu_id
&'a SpuId
req_msg
&'a RequestMessage<R>