Struct sota::broadcast::Broadcast
[−]
[src]
pub struct Broadcast<A: Clone> { // some fields omitted }
Retain a list of all peers that should receive the incoming message.
Methods
impl<A: Clone> Broadcast<A>
[src]
fn new(rx: Receiver<A>) -> Broadcast<A>
Instantiate a new broadcaster for the given Receiver
.
fn start(&self)
Start receiving broadcasting messages and forwarding each to the list of peers.
fn subscribe(&mut self) -> Receiver<A>
Add a new subscriber to the list of peers that will receive the broadcast messages.