fn start_in_arbiter<F>(wrk: &ArbiterHandle, f: F) -> Addr<Self>
    where
        Self: Actor<Context = Context<Self>>,
        F: FnOnce(&mut Context<Self>) -> Self + Send + 'static,
    {
        let (tx, rx) = channel::channel(DEFAULT_CAPACITY);

        // create actor
        wrk.spawn_fn(move || {
            let mut ctx = Context::with_receiver(rx);
            let act = f(&mut ctx);
            let fut = ctx.into_future(act);

            actix_rt::spawn(fut);
        });

        Addr::new(tx)
    }
/// Start new actor in arbiter's thread.
Start new actor in arbiter's thread.
Start new actor in arbiter ' s thread .
fn start_in_arbiter<F>(wrk: &ArbiterHandle, f: F) -> Addr<Self>
    where
        Self: Actor<Context = Context<Self>>,
        F: FnOnce(&mut Context<Self>) -> Self + Send + 'static,
    {
        let (tx, rx) = channel::channel(DEFAULT_CAPACITY);
        // create actor
        wrk.spawn_fn(move || {
            let mut ctx = Context::with_receiver(rx);
            let act = f(&mut ctx);
            let fut = ctx.into_future(act);
            actix_rt::spawn(fut);
        });
        Addr::new(tx)
    }
fn start_in_arbiter < F > ( wrk : & ArbiterHandle , f : F ) -> Addr < Self > where Self : Actor < Context = Context < Self > > , F : FnOnce ( & mut Context < Self > ) -> Self + Send + ' static , { let ( tx , rx ) = channel :: channel ( DEFAULT_CAPACITY ) ; // create actor wrk . spawn_fn ( move | | { let mut ctx = Context :: with_receiver ( rx ) ; let act = f ( & mut ctx ) ; let fut = ctx . into_future ( act ) ; actix_rt :: spawn ( fut ) ; } ) ; Addr :: new ( tx ) }
Start new actor in arbiter's thread.
Start new actor in arbiter ' s thread .
wrk
&ArbiterHandle
f
F
wrk
&ArbiterHandle
f
F