pub fn add_to_network<T: Payload>(
    network: &mut NetworkBuilder,
) -> (ConsensusNetworkSender<T>, ConsensusNetworkEvents<T>) {
    let (network_sender, network_receiver, connection_reqs_tx, connection_notifs_rx) = network
        .add_protocol_handler(
            vec![ProtocolId::ConsensusRpc],
            vec![ProtocolId::ConsensusDirectSend],
            QueueStyle::LIFO,
            NETWORK_CHANNEL_SIZE,
            Some(&counters::PENDING_CONSENSUS_NETWORK_EVENTS),
        );
    (
        ConsensusNetworkSender::new(
            network_sender,
            connection_reqs_tx,
            network
                .conn_mgr_reqs_tx()
                .expect("ConnecitivtyManager not enabled"),
        ),
        ConsensusNetworkEvents::new(network_receiver, connection_notifs_rx),
    )
}
/// Create a new Sender that only sends for the `CONSENSUS_DIRECT_SEND_PROTOCOL` and
/// `CONSENSUS_RPC_PROTOCOL` ProtocolId and a Receiver (Events) that explicitly returns only said
/// ProtocolId.
Create a new Sender that only sends for the `CONSENSUS_DIRECT_SEND_PROTOCOL` and
`CONSENSUS_RPC_PROTOCOL` ProtocolId and a Receiver (Events) that explicitly returns only said
ProtocolId.
Create a new Sender that only sends for the ` CONSENSUS_DIRECT_SEND_PROTOCOL ` and ` CONSENSUS_RPC_PROTOCOL ` ProtocolId and a Receiver ( Events ) that explicitly returns only said ProtocolId .
pub fn add_to_network<T: Payload>(
    network: &mut NetworkBuilder,
) -> (ConsensusNetworkSender<T>, ConsensusNetworkEvents<T>) {
    let (network_sender, network_receiver, connection_reqs_tx, connection_notifs_rx) = network
        .add_protocol_handler(
            vec![ProtocolId::ConsensusRpc],
            vec![ProtocolId::ConsensusDirectSend],
            QueueStyle::LIFO,
            NETWORK_CHANNEL_SIZE,
            Some(&counters::PENDING_CONSENSUS_NETWORK_EVENTS),
        );
    (
        ConsensusNetworkSender::new(
            network_sender,
            connection_reqs_tx,
            network
                .conn_mgr_reqs_tx()
                .expect("ConnecitivtyManager not enabled"),
        ),
        ConsensusNetworkEvents::new(network_receiver, connection_notifs_rx),
    )
}
pub fn add_to_network < T : Payload > ( network : & mut NetworkBuilder , ) -> ( ConsensusNetworkSender < T > , ConsensusNetworkEvents < T > ) { let ( network_sender , network_receiver , connection_reqs_tx , connection_notifs_rx ) = network . add_protocol_handler ( vec ! [ ProtocolId ConsensusRpc ] , vec ! [ ProtocolId ConsensusDirectSend ] , QueueStyle :: LIFO , NETWORK_CHANNEL_SIZE , Some ( & counters :: PENDING_CONSENSUS_NETWORK_EVENTS ) , ) ; ( ConsensusNetworkSender :: new ( network_sender , connection_reqs_tx , network . conn_mgr_reqs_tx ( ) . expect ( " " ) , ) , ConsensusNetworkEvents :: new ( network_receiver , connection_notifs_rx ) , ) }
Create a new Sender that only sends for the `CONSENSUS_DIRECT_SEND_PROTOCOL` and
`CONSENSUS_RPC_PROTOCOL` ProtocolId and a Receiver (Events) that explicitly returns only said
ProtocolId.
Create a new Sender that only sends for the ` CONSENSUS_DIRECT_SEND_PROTOCOL ` and ` CONSENSUS_RPC_PROTOCOL ` ProtocolId and a Receiver ( Events ) that explicitly returns only said ProtocolId .
network
&mut NetworkBuilder
network
&mut NetworkBuilder