hyperlane-plugin-shutdown 22.13.0

A graceful shutdown coordinator plugin for the Hyperlane framework providing OS signal arming (SIGINT/SIGTERM), lock-free in-flight request draining, bounded drain timeouts, LIFO async shutdown callbacks, and ServerControlHook integration.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use super::*;

/// Pluggable asynchronous cleanup hook executed in LIFO order during graceful shutdown.
pub trait ShutdownCallback: Send + Sync + 'static {
    /// Returns a human-readable identifier for this cleanup callback.
    ///
    /// # Returns
    ///
    /// - `&str` - Callback name recorded in [`ShutdownReport`].
    fn name(&self) -> &str;

    /// Executes cleanup work asynchronously during graceful shutdown.
    ///
    /// # Returns
    ///
    /// - `ShutdownFuture<'_>` - Future completing once cleanup finishes.
    fn on_shutdown(&self) -> ShutdownFuture<'_>;
}