atomr-core 0.3.0

Actors, supervision, dispatch, mailboxes, scheduler, FSM, event stream, and coordinated shutdown — the core of the atomr actor runtime.
Documentation
//! Broadcast router.

use crate::actor::ActorRef;

pub struct BroadcastRouter<M: Send + Clone + 'static> {
    routees: Vec<ActorRef<M>>,
}

impl<M: Send + Clone + 'static> BroadcastRouter<M> {
    pub fn new(routees: Vec<ActorRef<M>>) -> Self {
        Self { routees }
    }

    pub fn route(&self, msg: M) {
        for r in &self.routees {
            r.tell(msg.clone());
        }
    }
}