pub struct DefaultExecutor { /* private fields */ }Expand description
Creates a Tokio [Runtime] for use with CPU bound tasks
Tokio forbids dropping Runtimes in async contexts, so creating a separate
Runtime correctly is somewhat tricky. This structure manages the creation
and shutdown of a separate thread.
§Notes
On drop, the thread will wait for all remaining tasks to complete.
Depending on your application, more sophisticated shutdown logic may be required, such as ensuring that no new tasks are added to the runtime.
§Credits
This code is derived from code originally written for InfluxDB 3.0
Implementations§
Trait Implementations§
Source§impl Debug for DefaultExecutor
impl Debug for DefaultExecutor
Source§impl Default for DefaultExecutor
impl Default for DefaultExecutor
Source§impl DistExecutor for DefaultExecutor
impl DistExecutor for DefaultExecutor
Auto Trait Implementations§
impl Freeze for DefaultExecutor
impl !RefUnwindSafe for DefaultExecutor
impl Send for DefaultExecutor
impl Sync for DefaultExecutor
impl Unpin for DefaultExecutor
impl !UnwindSafe for DefaultExecutor
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
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