/// The method starts the P2P event handler loop for the individual flow
/// types.
The method starts the P2P event handler loop for the individual flow
types.
The method starts the P2P event handler loop for the individual flow types .
pub fn start(&self, gossip: GossipArc) {
        for flow_type in FlowType::iter() {
            let c_gossip = gossip.clone();
            match flow_type {
                FlowType::Advert => {
                    self.advert.start(move |item, peer_id| {
                        c_gossip.on_advert(item, peer_id);
                    });
                }
                FlowType::Request => {
                    self.request.start(move |item, peer_id| {
                        c_gossip.on_chunk_request(item, peer_id);
                    });
                }
                FlowType::Chunk => {
                    self.chunk.start(move |item, peer_id| {
                        c_gossip.on_chunk(item, peer_id);
                    });
                }
                FlowType::Retransmission => {
                    self.retransmission.start(move |item, peer_id| {
                        c_gossip.on_retransmission_request(item, peer_id);
                    });
                }
                FlowType::Transport => {
                    self.transport.start(move |item, _peer_id| match item {
                        TransportNotification::TransportStateChange(state_change) => {
                            c_gossip.on_transport_state_change(state_change)
                        }
                        TransportNotification::TransportError(error) => {
                            c_gossip.on_transport_error(error)
                        }
                    });
                }
                FlowType::SendAdvert => {
                    self.send_advert
                        .start(move |item, _peer_id| c_gossip.broadcast_advert(item));
                }
            }
        }
    }
pub fn start ( & self , gossip : GossipArc ) { for flow_type in FlowType :: iter ( ) { let c_gossip = gossip . clone ( ) ; match flow_type { FlowType :: Advert => { self . advert . start ( move | item , peer_id | { c_gossip . on_advert ( item , peer_id ) ; } ) ; } FlowType :: Request => { self . request . start ( move | item , peer_id | { c_gossip . on_chunk_request ( item , peer_id ) ; } ) ; } FlowType :: Chunk => { self . chunk . start ( move | item , peer_id | { c_gossip . on_chunk ( item , peer_id ) ; } ) ; } FlowType :: Retransmission => { self . retransmission . start ( move | item , peer_id | { c_gossip . on_retransmission_request ( item , peer_id ) ; } ) ; } FlowType :: Transport => { self . transport . start ( move | item , _peer_id | match item { TransportNotification :: TransportStateChange ( state_change ) => { c_gossip . on_transport_state_change ( state_change ) } TransportNotification :: TransportError ( error ) => { c_gossip . on_transport_error ( error ) } } ) ; } FlowType :: SendAdvert => { self . send_advert . start ( move | item , _peer_id | c_gossip . broadcast_advert ( item ) ) ; } } } }
The method starts the P2P event handler loop for the individual flow
types.
The method starts the P2P event handler loop for the individual flow types .
&self
gossip
GossipArc