Struct vortex_io::IoDispatcher
source · pub struct IoDispatcher(/* private fields */);
Expand description
IoDispatcher is unstable and may change in the future.
A cross-thread, cross-runtime dispatcher of async IO workloads.
IoDispatcher
s 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
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.
pub fn new_compio(num_threads: usize) -> Self
Trait Implementations§
source§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>>
Dispatch a new asynchronous task. Read more
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
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Converts
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>
Converts
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