pub async fn stop_worker<S: ToString>(&self, address: S) -> Result<()> {
        let (reply_tx, mut reply_rx) = channel(1);
        let msg = NodeMessage::StopWorker(address.to_string(), reply_tx);

        match self.sender.send(msg).await {
            Ok(()) => {
                if let Some(NodeReply::Ok) = reply_rx.recv().await {
                    Ok(())
                } else {
                    Err(Error::FailedStopWorker.into())
                }
            }
            Err(_e) => Err(Error::FailedStopWorker.into()),
        }
    }
/// Shut down a worker with a specific address
Shut down a worker with a specific address
Shut down a worker with a specific address
pub async fn stop_worker<S: ToString>(&self, address: S) -> Result<()> {
        let (reply_tx, mut reply_rx) = channel(1);
        let msg = NodeMessage::StopWorker(address.to_string(), reply_tx);
        match self.sender.send(msg).await {
            Ok(()) => {
                if let Some(NodeReply::Ok) = reply_rx.recv().await {
                    Ok(())
                } else {
                    Err(Error::FailedStopWorker.into())
                }
            }
            Err(_e) => Err(Error::FailedStopWorker.into()),
        }
    }
pub async fn stop_worker < S : ToString > ( & self , address : S ) -> Result < ( ) > { let ( reply_tx , mut reply_rx ) = channel ( 1 ) ; let msg = NodeMessage :: StopWorker ( address . to_string ( ) , reply_tx ) ; match self . sender . send ( msg ) . await { Ok ( ( ) ) => { if let Some ( NodeReply :: Ok ) = reply_rx . recv ( ) . await { Ok ( ( ) ) } else { Err ( Error :: FailedStopWorker . into ( ) ) } } Err ( _e ) => Err ( Error :: FailedStopWorker . into ( ) ) , } }
Shut down a worker with a specific address
Shut down a worker with a specific address
&self
address
S
&self
address
S