pub enum Runtime {
Steal(Runtime),
NoSteal(NoStealRuntime),
}
Expand description
Pingora async multi-threaded runtime
The Steal
flavor is effectively tokio multi-threaded runtime.
The NoSteal
flavor is backed by multiple tokio single-threaded runtime.
Variants§
Steal(Runtime)
NoSteal(NoStealRuntime)
Implementations§
Source§impl Runtime
impl Runtime
Sourcepub fn new_steal(threads: usize, name: &str) -> Self
pub fn new_steal(threads: usize, name: &str) -> Self
Create a Steal
flavor runtime. This just a regular tokio runtime
Sourcepub fn new_no_steal(threads: usize, name: &str) -> Self
pub fn new_no_steal(threads: usize, name: &str) -> Self
Create a NoSteal
flavor runtime. This is backed by multiple tokio current-thread runtime
Sourcepub fn get_handle(&self) -> &Handle
pub fn get_handle(&self) -> &Handle
Sourcepub fn shutdown_timeout(self, timeout: Duration)
pub fn shutdown_timeout(self, timeout: Duration)
Call tokio’s shutdown_timeout
of all the runtimes. This function is blocking until
all runtimes exit.
Auto Trait Implementations§
impl !Freeze for Runtime
impl !RefUnwindSafe for Runtime
impl Send for Runtime
impl Sync for Runtime
impl Unpin for Runtime
impl !UnwindSafe for Runtime
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