pub struct Runtime<S> { /* private fields */ }Expand description
Runtime task manager for runnable providers.
This keeps JoinSet orchestration out of bootstrap and ensures shutdown is observed immediately via the shared shutdown token.
Implementations§
Source§impl<S> Runtime<S>where
S: SharedState,
impl<S> Runtime<S>where
S: SharedState,
Sourcepub async fn wait_until_shutdown(&mut self, state: &S) -> Result<()>
pub async fn wait_until_shutdown(&mut self, state: &S) -> Result<()>
Run until shutdown is initiated or a critical runnable failure occurs.
Returns:
Ok(())when the shutdown token is cancelled or all runnables finished.Err(_)on critical startup/join failures.
Source§impl<S> Runtime<S>
impl<S> Runtime<S>
Sourcepub async fn abort_and_drain(&mut self)
pub async fn abort_and_drain(&mut self)
Abort and drain all remaining runnable tasks.
Sourcepub async fn drain(&mut self) -> Result<()>
pub async fn drain(&mut self) -> Result<()>
Wait for all remaining runnable tasks to finish on their own.
Shutdown-aware listeners do their protocol-level graceful drain inside
their runnable future. The bootstrap layer must give those futures a
chance to complete before falling back to abort_and_drain.
Trait Implementations§
Auto Trait Implementations§
impl<S> Freeze for Runtime<S>
impl<S> RefUnwindSafe for Runtime<S>
impl<S> Send for Runtime<S>
impl<S> Sync for Runtime<S>
impl<S> Unpin for Runtime<S>
impl<S> UnsafeUnpin for Runtime<S>
impl<S> UnwindSafe for Runtime<S>
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