pub struct LifeCycle { /* private fields */ }
Expand description
The LifeCycle struct represents the life_cycle of this server process. Creating an instance of it will prepare the global state of the process and allow other code to work with Activity and ShutdownSubcription.
Implementations§
source§impl LifeCycle
impl LifeCycle
sourcepub fn new() -> Self
pub fn new() -> Self
Initialize the process life_cycle. May be called only once; will panic if called multiple times.
sourcepub async fn request_shutdown()
pub async fn request_shutdown()
Request that we shutdown the process. This will cause the wait_for_shutdown method on the process LifeCycle instance to wake up and initiate the shutdown procedure.
sourcepub async fn wait_for_shutdown(&mut self)
pub async fn wait_for_shutdown(&mut self)
Wait for a shutdown request, then propagate that state to running tasks, and then wait for those tasks to complete before returning to the caller.
Auto Trait Implementations§
impl Freeze for LifeCycle
impl RefUnwindSafe for LifeCycle
impl Send for LifeCycle
impl Sync for LifeCycle
impl Unpin for LifeCycle
impl UnwindSafe for LifeCycle
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