/// Service to broadcast messages from the leader to layer 1 nodes.
/// See `crdt` for network layer definitions.
/// # Arguments
/// * `sock` - Socket to send from.
/// * `exit` - Boolean to signal system exit.
/// * `crdt` - CRDT structure
/// * `recycler` - Blob recycler.
/// * `r` - Receive channel for blobs to be retransmitted to all the layer 1 nodes.
Service to broadcast messages from the leader to layer 1 nodes.
See `crdt` for network layer definitions.
Service to broadcast messages from the leader to layer 1 nodes . See ` crdt ` for network layer definitions .
pub fn broadcaster(
    sock: UdpSocket,
    exit: Arc<AtomicBool>,
    crdt: Arc<RwLock<Crdt>>,
    recycler: BlobRecycler,
    r: BlobReceiver,
) -> JoinHandle<()> {
    spawn(move || {
        let mut transmit_index = 0;
        loop {
            if exit.load(Ordering::Relaxed) {
                break;
            }
            let _ = broadcast(&crdt, &recycler, &r, &sock, &mut transmit_index);
        }
    })
}
pub fn broadcaster ( sock : UdpSocket , exit : Arc < AtomicBool > , crdt : Arc < RwLock < Crdt > > , recycler : BlobRecycler , r : BlobReceiver , ) -> JoinHandle < ( ) > { spawn ( move | | { let mut transmit_index = 0 ; loop { if exit . load ( Ordering :: Relaxed ) { break ; } let _ = broadcast ( & crdt , & recycler , & r , & sock , & mut transmit_index ) ; } } ) }
Service to broadcast messages from the leader to layer 1 nodes.
Service to broadcast messages from the leader to layer 1 nodes .
sock
UdpSocket
exit
Arc<AtomicBool>
crdt
Arc<RwLock<Crdt>>
recycler
BlobRecycler
r
BlobReceiver