[][src]Struct actix::Arbiter

pub struct Arbiter { /* fields omitted */ }

An event loop controller.

An arbiter controls the event loop in its thread. Each arbiter runs in a separate thread and provides several methods for event loop access. Each arbiter can belong to a specific System actor.

By default, a panic in an arbiter does not stop the rest of the system, unless the panic is in the system actor. Users of an arbiter can opt into shutting down the system on panic by using Arbiter::builder() and enabling stop_system_on_panic.

Methods

impl Arbiter
[src]

pub fn builder() -> ArbiterBuilder
[src]

Returns a builder object for customized arbiter creation.

pub fn new<T: Into<String>>(name: T) -> Addr<Arbiter>
[src]

Spawns a new thread and runs the event loop in the spawned thread.

Returns the address of the newly created arbiter. Does not stop the system on panic.

pub fn name() -> String
[src]

Returns current arbiter's name

pub fn current() -> Addr<Arbiter>
[src]

Returns the current arbiter's address.

pub fn registry() -> Registry
[src]

Returns the arbiter's registry,

pub fn spawn<F>(future: F) where
    F: Future<Item = (), Error = ()> + 'static, 
[src]

Executes a future on the current thread.

pub fn spawn_fn<F, R>(f: F) where
    F: FnOnce() -> R + 'static,
    R: IntoFuture<Item = (), Error = ()> + 'static, 
[src]

Executes a lazily constructed future on the current thread.

The provided closure is run as part of future execution. After it returns, execution will continue with the future created by the closure.

pub fn start<A, F>(f: F) -> Addr<A> where
    A: Actor<Context = Context<A>>,
    F: FnOnce(&mut A::Context) -> A + Send + 'static, 
[src]

Starts an actor inside a newly created arbiter.

Returns the address of the actor created.

Trait Implementations

impl Actor for Arbiter
[src]

type Context = Context<Self>

Actor execution context type

fn started(&mut self, ctx: &mut Self::Context)
[src]

Called when an actor gets polled the first time.

fn stopping(&mut self, ctx: &mut Self::Context) -> Running
[src]

Called after an actor is in Actor::Stopping state. Read more

fn stopped(&mut self, ctx: &mut Self::Context)
[src]

Called after an actor is stopped. Read more

fn start(self) -> Addr<Self> where
    Self: Actor<Context = Context<Self>>, 
[src]

Start a new asynchronous actor, returning its address. Read more

fn start_default() -> Addr<Self> where
    Self: Actor<Context = Context<Self>> + Default
[src]

Construct and start a new asynchronous actor, returning its address. Read more

fn create<F>(f: F) -> Addr<Self> where
    Self: Actor<Context = Context<Self>>,
    F: FnOnce(&mut Context<Self>) -> Self + 'static, 
[src]

Start a new asynchronous actor given a Context. Read more

impl Handler<StopArbiter> for Arbiter
[src]

type Result = ()

The type of value that this handler will return.

impl<A> Handler<StartActor<A>> for Arbiter where
    A: Actor<Context = Context<A>>, 
[src]

type Result = Addr<A>

The type of value that this handler will return.

impl<I: Send, E: Send> Handler<Execute<I, E>> for Arbiter
[src]

type Result = Result<I, E>

The type of value that this handler will return.

impl Drop for Arbiter
[src]

impl Debug for Arbiter
[src]

Auto Trait Implementations

impl Send for Arbiter

impl Sync for Arbiter

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T