pub struct Arbiter { /* private fields */ }
Expand description
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
pub fn with_tokio_rt<F>(runtime_factory: F) -> Arbiter where
F: 'static + Fn() -> Runtime + Send,
pub fn with_tokio_rt<F>(runtime_factory: F) -> Arbiter where
F: 'static + Fn() -> Runtime + Send,
Spawn a new Arbiter using the Tokio Runtime returned from a closure.
Return a handle to the this Arbiter’s message sender.
Return a handle to the current thread’s Arbiter’s message sender.
Panics
Panics if no Arbiter is running on the current thread.
Try to get current running arbiter handle.
Returns None
if no Arbiter has been started.
Unlike current
, this never panics.
Stop Arbiter from continuing it’s event loop.
Returns true if stop message was sent successfully and false if the Arbiter has been dropped.
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.
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.
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for Arbiter
impl !UnwindSafe for Arbiter
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more