pub struct IoDispatcher(/* private fields */);Expand description
A cross-thread, cross-runtime dispatcher of async IO workloads.
IoDispatchers are handles to an async runtime that can handle work submissions and
multiplexes them across a set of worker threads. Unlike an async runtime, which is free
to balance tasks as they see fit, the purpose of the Dispatcher is to enable the spawning
of asynchronous, !Send tasks across potentially many worker threads, and allowing work
submission from any other runtime.
Implementations§
Source§impl IoDispatcher
impl IoDispatcher
pub fn new() -> Self
Sourcepub fn new_tokio(num_thread: usize) -> Self
pub fn new_tokio(num_thread: usize) -> Self
Create a new IO dispatcher that uses a set of Tokio current_thread runtimes to
execute both Send and !Send futures.
A handle to the dispatcher can be passed freely among threads, allowing multiple parties to perform dispatching across different threads.
Source§impl IoDispatcher
impl IoDispatcher
Returns a handle to the current process’s shared Dispatcher.
Trait Implementations§
Source§impl Clone for IoDispatcher
impl Clone for IoDispatcher
Source§fn clone(&self) -> IoDispatcher
fn clone(&self) -> IoDispatcher
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for IoDispatcher
impl Debug for IoDispatcher
Source§impl Default for IoDispatcher
impl Default for IoDispatcher
Source§impl Dispatch for IoDispatcher
impl Dispatch for IoDispatcher
Source§fn dispatch<F, Fut, R>(&self, task: F) -> VortexResult<JoinHandle<R>>
fn dispatch<F, Fut, R>(&self, task: F) -> VortexResult<JoinHandle<R>>
Auto Trait Implementations§
impl Freeze for IoDispatcher
impl !RefUnwindSafe for IoDispatcher
impl Send for IoDispatcher
impl Sync for IoDispatcher
impl Unpin for IoDispatcher
impl !UnwindSafe for IoDispatcher
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more