pub async fn join(&self, req: JoinRequest) -> StoreResult<()> {
        // TODO: check if this node is already in learner list.
        let resp = self.redirect_if_needed(&req, true).await?;

        if let Some(forward_resp) = resp {
            match forward_resp {
                ForwardResponse::Join(_) => return Ok(()),
                _ => panic!("BUG: need JoinResponse"),
            }
        }

        let l = self.as_leader().await;
        match l {
            Ok(l) => l.join(req).await,
            Err(e) => return Err(RaftError::ForwardToLeader(e).into()),
        }
    }
// join the node with the given ID, reachable at addr, to this node.
join the node with the given ID, reachable at addr, to this node.
join the node with the given ID reachable at addr to this node .
pub async fn join(&self, req: JoinRequest) -> StoreResult<()> {
        // TODO: check if this node is already in learner list.
        let resp = self.redirect_if_needed(&req, true).await?;
        if let Some(forward_resp) = resp {
            match forward_resp {
                ForwardResponse::Join(_) => return Ok(()),
                _ => panic!("BUG: need JoinResponse"),
            }
        }
        let l = self.as_leader().await;
        match l {
            Ok(l) => l.join(req).await,
            Err(e) => return Err(RaftError::ForwardToLeader(e).into()),
        }
    }
pub async fn join ( & self , req : JoinRequest ) -> StoreResult < ( ) > { // TODO: check if this node is already in learner list. let resp = self . redirect_if_needed ( & req , true ) . await ? ; if let Some ( forward_resp ) = resp { match forward_resp { ForwardResponse :: Join ( _ ) => return Ok ( ( ) ) , _ => panic ! ( " " ) , } } let l = self . as_leader ( ) . await ; match l { Ok ( l ) => l . join ( req ) . await , Err ( e ) => return Err ( RaftError :: ForwardToLeader ( e ) . into ( ) ) , } }
join the node with the given ID, reachable at addr, to this node.
join the node with the given ID reachable at addr to this node .
&self
req
JoinRequest
&self
req
JoinRequest