[−][src]Struct actix::prelude::Arbiter
Arbiters provide an asynchronous execution environment for actors, functions and futures. When an Arbiter is created, it spawns a new OS thread, and hosts an event loop. Some Arbiter functions execute on the current thread.
Implementations
impl Arbiter
[src]
pub fn current() -> Arbiter
[src]
Returns the current thread's arbiter's address. If no Arbiter is present, then this function will panic!
pub fn is_running() -> bool
[src]
Thread local variables for running state of Arbiter is removed
Check if current arbiter is running.
pub fn stop(&self)
[src]
Stop arbiter from continuing it's event loop.
pub fn new() -> Arbiter
[src]
Spawn new thread and run event loop in spawned thread. Returns address of newly created arbiter.
pub fn spawn<F>(future: F) where
F: Future<Output = ()> + 'static,
[src]
F: Future<Output = ()> + 'static,
Spawn a future on the current thread. This does not create a new Arbiter or Arbiter address, it is simply a helper for spawning futures on the current thread.
pub fn spawn_fn<F, R>(f: F) where
R: Future<Output = ()> + 'static,
F: FnOnce() -> R + 'static,
[src]
R: Future<Output = ()> + 'static,
F: FnOnce() -> R + 'static,
Executes a future on the current thread. This does not create a new Arbiter or Arbiter address, it is simply a helper for executing futures on the current thread.
pub fn send<F>(&self, future: F) where
F: Future<Output = ()> + Send + Unpin + 'static,
[src]
F: Future<Output = ()> + Send + Unpin + 'static,
Send a future to the Arbiter's thread, and spawn it.
pub fn exec_fn<F>(&self, f: F) 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.
pub fn exec<F, R>(&self, f: F) -> impl Future<Output = Result<R, RecvError>> where
R: Send + 'static,
F: FnOnce() -> R + Send + 'static,
[src]
R: Send + 'static,
F: FnOnce() -> R + Send + 'static,
Send a function to the Arbiter's thread. This function will be executed asynchronously. A future is created, and when resolved will contain the result of the function sent to the Arbiters thread.
pub fn set_item<T>(item: T) where
T: 'static,
[src]
T: 'static,
Set item to arbiter storage
pub fn contains_item<T>() -> bool where
T: 'static,
[src]
T: 'static,
Check if arbiter storage contains item
pub fn get_item<T, F, R>(f: F) -> R where
F: FnMut(&T) -> R,
T: 'static,
[src]
F: FnMut(&T) -> R,
T: 'static,
Get a reference to a type previously inserted on this arbiter's storage.
Panics is item is not inserted
pub fn get_mut_item<T, F, R>(f: F) -> R where
F: FnMut(&mut T) -> R,
T: 'static,
[src]
F: FnMut(&mut T) -> R,
T: 'static,
Get a mutable reference to a type previously inserted on this arbiter's storage.
Panics is item is not inserted
pub fn join(&mut self) -> Result<(), Box<dyn Any + 'static + Send, Global>>
[src]
Wait for the event loop to stop by joining the underlying thread (if have Some).
pub async fn local_join()
[src]
Arbiter::local_join function is removed.
Returns a future that will be completed once all currently spawned futures have completed.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Arbiter
[src]
impl Send for Arbiter
[src]
impl Sync for Arbiter
[src]
impl Unpin for Arbiter
[src]
impl !UnwindSafe for Arbiter
[src]
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> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,