abscissa_core/shutdown.rs
1//! Application shutdown support
2
3/// Types of shutdown recognized by Abscissa
4#[derive(Copy, Clone, Debug, Eq, Hash, PartialEq)]
5pub enum Shutdown {
6 /// Graceful shutdowns may take prolonged periods of time, allowing
7 /// components to take their time to ensure shutdowns occur cleanly
8 /// (e.g. draining currently active traffic rather than closing sockets)
9 Graceful,
10
11 /// Forced shutdowns indicate the program's user has requested it terminate
12 /// immediately. Components receiving this kind of shutdown should do only
13 /// critical cleanup tasks which can be completed quickly.
14 Forced,
15
16 /// This shutdown type is a "best effort" to communicate that the
17 /// application has suffered from a critical error and is in the process
18 /// of exiting. Components may use this to do crash reporting prior
19 /// to the application exit, as well as any other cleanup deemed suitable
20 /// within a crashing application.
21 Crash,
22}