pub(crate) fn broadcast_message(&self, target: BroadcastTarget, message: &Arc<SignedMessage>) {
        let mut acked_dispatchers: Vec<DispatcherType> = Vec::new();

        match target {
            BroadcastTarget::All => self
                .dispatchers
                .iter()
                .map(|pair| pair.0.name().into())
                .for_each(|group_name| acked_dispatchers.push(group_name)),
            BroadcastTarget::Group(name) => {
                let target_dispatcher = name.into();
                acked_dispatchers.push(target_dispatcher);
            }
        }

        for dispatcher_type in acked_dispatchers {
            match self.dispatchers.get(&dispatcher_type) {
                Some(dispatcher) => {
                    dispatcher.broadcast_message(&message.clone());
                }
                // TODO: Put the message into the dead queue
                None => {
                    let name = dispatcher_type.name();
                    warn!(
                        "The message can't be delivered to the group with the '{}' name.",
                        name
                    );
                }
            }
        }
    }
/// Broadcasts the given message in according with the specified target.
Broadcasts the given message in according with the specified target.
Broadcasts the given message in according with the specified target .
pub(crate) fn broadcast_message(&self, target: BroadcastTarget, message: &Arc<SignedMessage>) {
        let mut acked_dispatchers: Vec<DispatcherType> = Vec::new();
        match target {
            BroadcastTarget::All => self
                .dispatchers
                .iter()
                .map(|pair| pair.0.name().into())
                .for_each(|group_name| acked_dispatchers.push(group_name)),
            BroadcastTarget::Group(name) => {
                let target_dispatcher = name.into();
                acked_dispatchers.push(target_dispatcher);
            }
        }
        for dispatcher_type in acked_dispatchers {
            match self.dispatchers.get(&dispatcher_type) {
                Some(dispatcher) => {
                    dispatcher.broadcast_message(&message.clone());
                }
                // TODO: Put the message into the dead queue
                None => {
                    let name = dispatcher_type.name();
                    warn!(
                        "The message can't be delivered to the group with the '{}' name.",
                        name
                    );
                }
            }
        }
    }
pub ( crate ) fn broadcast_message ( & self , target : BroadcastTarget , message : & Arc < SignedMessage > ) { let mut acked_dispatchers : Vec < DispatcherType > = Vec :: new ( ) ; match target { BroadcastTarget :: All => self . dispatchers . iter ( ) . map ( | pair | pair . 0 . name ( ) . into ( ) ) . for_each ( | group_name | acked_dispatchers . push ( group_name ) ) , BroadcastTarget :: Group ( name ) => { let target_dispatcher = name . into ( ) ; acked_dispatchers . push ( target_dispatcher ) ; } } for dispatcher_type in acked_dispatchers { match self . dispatchers . get ( & dispatcher_type ) { Some ( dispatcher ) => { dispatcher . broadcast_message ( & message . clone ( ) ) ; } // TODO: Put the message into the dead queue None => { let name = dispatcher_type . name ( ) ; warn ! ( " " name ) ; } } } }
Broadcasts the given message in according with the specified target.
Broadcasts the given message in according with the specified target .
&self
target
BroadcastTarget
message
&Arc<SignedMessage>
&self
target
BroadcastTarget
message
&Arc<SignedMessage>