async fn register(&mut self) -> Result<(), Error> {
        let payload = RegisterArgs {
            id: self.node.clone(),
            grpc_endpoint: self.grpc_endpoint.clone(),
        };
        match &mut self.client {
            Some(client) => client
                .publish("register", serde_json::to_vec(&payload).unwrap())
                .await
                .map_err(|cause| Error::QueueRegister {
                    cause,
                })?,
            None => return Err(Error::NotStarted {}),
        }
        // Note that the message was only queued and we don't know if it was
        // really sent to the NATS server (limitation of the nats lib)
        debug!(
            "Registered '{}' and grpc server {}",
            self.node, self.grpc_endpoint
        );
        Ok(())
    }
/// Send a register message to the NATS server.
Send a register message to the NATS server.
Send a register message to the NATS server .
async fn register(&mut self) -> Result<(), Error> {
        let payload = RegisterArgs {
            id: self.node.clone(),
            grpc_endpoint: self.grpc_endpoint.clone(),
        };
        match &mut self.client {
            Some(client) => client
                .publish("register", serde_json::to_vec(&payload).unwrap())
                .await
                .map_err(|cause| Error::QueueRegister {
                    cause,
                })?,
            None => return Err(Error::NotStarted {}),
        }
        // Note that the message was only queued and we don't know if it was
        // really sent to the NATS server (limitation of the nats lib)
        debug!(
            "Registered '{}' and grpc server {}",
            self.node, self.grpc_endpoint
        );
        Ok(())
    }
async fn register ( & mut self ) -> Result < ( ) , Error > { let payload = RegisterArgs { id : self . node . clone ( ) , grpc_endpoint : self . grpc_endpoint . clone ( ) , } ; match & mut self . client { Some ( client ) => client . publish ( " " , serde_json :: to_vec ( & payload ) . unwrap ( ) ) . await . map_err ( | cause | Error :: QueueRegister { cause , } ) ? , None => return Err ( Error :: NotStarted { } ) , } // Note that the message was only queued and we don't know if it was // really sent to the NATS server (limitation of the nats lib) debug ! ( " " self node self grpc_endpoint ) ; Ok ( ( ) ) }
Send a register message to the NATS server.
Send a register message to the NATS server .
&mut self
&mut self