pub async fn start(self) -> Address<A> {
        let num = self.config.num;

        let (tx, rx) = unbounded_channel::<ContextMessage<A>>();

        let state = ActorState::new(self.config);
        let mut broadcast_senders = Vec::with_capacity(num);

        match num {
            1 => {
                let actor = self.actor_builder.build().await;

                let broadcast_receiver = state.broadcast_receiver(&mut broadcast_senders, num);
                ActorContext::new(
                    0,
                    tx.downgrade(),
                    rx,
                    broadcast_receiver,
                    actor,
                    state.clone(),
                )
                .spawn_loop();

                Address::new(tx, broadcast_senders.into(), state)
            }
            _ => {
                for i in 0..num {
                    let actor = self.actor_builder.build().await;

                    let broadcast_receiver = state.broadcast_receiver(&mut broadcast_senders, num);

                    ActorContext::new(
                        i,
                        tx.downgrade(),
                        rx.clone(),
                        broadcast_receiver,
                        actor,
                        state.clone(),
                    )
                    .spawn_loop();
                }

                Address::new(tx, broadcast_senders.into(), state)
            }
        }
    }
/// Start actor(s) with the Builder settings.
Start actor(s) with the Builder settings.
Start actor ( s ) with the Builder settings .
pub async fn start(self) -> Address<A> {
        let num = self.config.num;
        let (tx, rx) = unbounded_channel::<ContextMessage<A>>();
        let state = ActorState::new(self.config);
        let mut broadcast_senders = Vec::with_capacity(num);
        match num {
            1 => {
                let actor = self.actor_builder.build().await;
                let broadcast_receiver = state.broadcast_receiver(&mut broadcast_senders, num);
                ActorContext::new(
                    0,
                    tx.downgrade(),
                    rx,
                    broadcast_receiver,
                    actor,
                    state.clone(),
                )
                .spawn_loop();
                Address::new(tx, broadcast_senders.into(), state)
            }
            _ => {
                for i in 0..num {
                    let actor = self.actor_builder.build().await;
                    let broadcast_receiver = state.broadcast_receiver(&mut broadcast_senders, num);
                    ActorContext::new(
                        i,
                        tx.downgrade(),
                        rx.clone(),
                        broadcast_receiver,
                        actor,
                        state.clone(),
                    )
                    .spawn_loop();
                }
                Address::new(tx, broadcast_senders.into(), state)
            }
        }
    }
pub async fn start ( self ) -> Address < A > { let num = self . config . num ; let ( tx , rx ) = unbounded_channel :: < ContextMessage < A > > ( ) ; let state = ActorState :: new ( self . config ) ; let mut broadcast_senders = Vec :: with_capacity ( num ) ; match num { 1 => { let actor = self . actor_builder . build ( ) . await ; let broadcast_receiver = state . broadcast_receiver ( & mut broadcast_senders , num ) ; ActorContext :: new ( 0 , tx . downgrade ( ) , rx , broadcast_receiver , actor , state . clone ( ) , ) . spawn_loop ( ) ; Address :: new ( tx , broadcast_senders . into ( ) , state ) } _ => { for i in 0 .. num { let actor = self . actor_builder . build ( ) . await ; let broadcast_receiver = state . broadcast_receiver ( & mut broadcast_senders , num ) ; ActorContext :: new ( i , tx . downgrade ( ) , rx . clone ( ) , broadcast_receiver , actor , state . clone ( ) , ) . spawn_loop ( ) ; } Address :: new ( tx , broadcast_senders . into ( ) , state ) } } }
Start actor(s) with the Builder settings.
Start actor ( s ) with the Builder settings .
self