Struct actix::Arbiter [−][src]
An Arbiter represents a thread that provides an asynchronous execution environment for futures and functions.
When an arbiter is created, it spawns a new OS thread, and hosts an event loop.
Implementations
impl Arbiter
[src]
pub fn new() -> Arbiter
[src]
Spawn a new Arbiter thread and start its event loop.
Panics
Panics if a System is not registered on the current thread.
pub fn handle(&self) -> ArbiterHandle
[src]
Return a handle to the this Arbiter’s message sender.
pub fn current() -> ArbiterHandle
[src]
Return a handle to the current thread’s Arbiter’s message sender.
Panics
Panics if no Arbiter is running on the current thread.
pub fn stop(&self) -> bool
[src]
Stop Arbiter from continuing it’s event loop.
Returns true if stop message was sent successfully and false if the Arbiter has been dropped.
pub fn spawn<Fut>(&self, future: Fut) -> bool where
Fut: Future<Output = ()> + Send + 'static,
[src]
Fut: Future<Output = ()> + Send + 'static,
Send a future to the Arbiter’s thread and spawn it.
If you require a result, include a response channel in the future.
Returns true if future was sent successfully and false if the Arbiter has died.
pub fn spawn_fn<F>(&self, f: F) -> bool where
F: FnOnce() + Send + 'static,
[src]
F: FnOnce() + Send + 'static,
Send a function to the Arbiter’s thread and execute it.
Any result from the function is discarded. If you require a result, include a response channel in the function.
Returns true if function was sent successfully and false if the Arbiter has died.
pub fn join(self) -> Result<(), Box<dyn Any + 'static + Send, Global>>
[src]
Wait for Arbiter’s event loop to complete.
Joins the underlying OS thread handle. See JoinHandle::join
.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Arbiter
impl Send for Arbiter
impl Sync for Arbiter
impl Unpin for Arbiter
impl !UnwindSafe for Arbiter
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,