async fn send_message(&self, flow: FlowId, message: TransportPayload) -> Result<(), SendError> {
        let gossip_message = <pb::GossipMessage as ProtoProxy<GossipMessage>>::proxy_decode(
            &message.0,
        )
        .map_err(|e| {
            trace!(self.log, "Deserialization failed {}", e);
            SendError::DeserializationFailed
        })?;
        let start_time = std::time::Instant::now();
        let (msg_type, ret) = match gossip_message {
            GossipMessage::Advert(msg) => {
                let send_map = &self.peer_flows.advert.send_map;
                (
                    "Advert",
                    self.send_gossip_message(send_map, flow.peer_id, msg).await,
                )
            }
            GossipMessage::ChunkRequest(msg) => {
                let send_map = &self.peer_flows.request.send_map;
                (
                    "Request",
                    self.send_gossip_message(send_map, flow.peer_id, msg).await,
                )
            }
            GossipMessage::Chunk(msg) => {
                let send_map = &self.peer_flows.chunk.send_map;
                (
                    "Chunk",
                    self.send_gossip_message(send_map, flow.peer_id, msg).await,
                )
            }
            GossipMessage::RetransmissionRequest(msg) => {
                let send_map = &self.peer_flows.retransmission.send_map;
                (
                    "Retransmission",
                    self.send_gossip_message(send_map, flow.peer_id, msg).await,
                )
            }
        };
        self.metrics
            .send_message_duration_ms
            .with_label_values(&[msg_type])
            .observe(start_time.elapsed().as_millis() as f64);
        ret
    }
/// The method sends the given message on the flow associated with the given
/// flow ID.
The method sends the given message on the flow associated with the given
flow ID.
The method sends the given message on the flow associated with the given flow ID .
async fn send_message(&self, flow: FlowId, message: TransportPayload) -> Result<(), SendError> {
        let gossip_message = <pb::GossipMessage as ProtoProxy<GossipMessage>>::proxy_decode(
            &message.0,
        )
        .map_err(|e| {
            trace!(self.log, "Deserialization failed {}", e);
            SendError::DeserializationFailed
        })?;
        let start_time = std::time::Instant::now();
        let (msg_type, ret) = match gossip_message {
            GossipMessage::Advert(msg) => {
                let send_map = &self.peer_flows.advert.send_map;
                (
                    "Advert",
                    self.send_gossip_message(send_map, flow.peer_id, msg).await,
                )
            }
            GossipMessage::ChunkRequest(msg) => {
                let send_map = &self.peer_flows.request.send_map;
                (
                    "Request",
                    self.send_gossip_message(send_map, flow.peer_id, msg).await,
                )
            }
            GossipMessage::Chunk(msg) => {
                let send_map = &self.peer_flows.chunk.send_map;
                (
                    "Chunk",
                    self.send_gossip_message(send_map, flow.peer_id, msg).await,
                )
            }
            GossipMessage::RetransmissionRequest(msg) => {
                let send_map = &self.peer_flows.retransmission.send_map;
                (
                    "Retransmission",
                    self.send_gossip_message(send_map, flow.peer_id, msg).await,
                )
            }
        };
        self.metrics
            .send_message_duration_ms
            .with_label_values(&[msg_type])
            .observe(start_time.elapsed().as_millis() as f64);
        ret
    }
async fn send_message ( & self , flow : FlowId , message : TransportPayload ) -> Result < ( ) , SendError > { let gossip_message = < pb :: GossipMessage as ProtoProxy < GossipMessage > > :: proxy_decode ( & message . 0 , ) . map_err ( | e | { trace ! ( self log " " e ) ; SendError :: DeserializationFailed } ) ? ; let start_time = std :: time :: Instant :: now ( ) ; let ( msg_type , ret ) = match gossip_message { GossipMessage :: Advert ( msg ) => { let send_map = & self . peer_flows . advert . send_map ; ( " " , self . send_gossip_message ( send_map , flow . peer_id , msg ) . await , ) } GossipMessage :: ChunkRequest ( msg ) => { let send_map = & self . peer_flows . request . send_map ; ( " " , self . send_gossip_message ( send_map , flow . peer_id , msg ) . await , ) } GossipMessage :: Chunk ( msg ) => { let send_map = & self . peer_flows . chunk . send_map ; ( " " , self . send_gossip_message ( send_map , flow . peer_id , msg ) . await , ) } GossipMessage :: RetransmissionRequest ( msg ) => { let send_map = & self . peer_flows . retransmission . send_map ; ( " " , self . send_gossip_message ( send_map , flow . peer_id , msg ) . await , ) } } ; self . metrics . send_message_duration_ms . with_label_values ( & [ msg_type ] ) . observe ( start_time . elapsed ( ) . as_millis ( ) as f64 ) ; ret }
The method sends the given message on the flow associated with the given
flow ID.
The method sends the given message on the flow associated with the given flow ID .
&self
flow
FlowId
message
TransportPayload
&self
flow
FlowId
message
TransportPayload