<div align="center">
<img src="https://devhub.vip/pages/docs/img/hyperlane.png" alt="hyperlane-plugin-shutdown logo" height="120">
# hyperlane-plugin-shutdown
**Graceful Shutdown Coordinator, OS Signal Arming & Request Drain Plugin**
[](https://crates.io/crates/hyperlane-plugin-shutdown)
[](https://docs.rs/hyperlane-plugin-shutdown)
[](https://github.com/hyperlane-dev/hyperlane/actions/workflows/rust.yml)
[](https://www.rust-lang.org)
[](../../LICENSE)
[Workspace Overview](../../README.md) · [Plugin Catalog](../README.md) · [API Docs](https://docs.rs/hyperlane-plugin-shutdown/latest/)
</div>
---
## Overview
`hyperlane-plugin-shutdown` coordinates OS signal handling (`SIGINT`/`SIGTERM`), lock-free in-flight request draining, and ordered cleanup callbacks for [`hyperlane`](../../README.md) services.
## Installation
```sh
cargo add hyperlane-plugin-shutdown
```
## Usage
```rust
use hyperlane_plugin_shutdown::{ShutdownConfig, ShutdownCoordinator, ShutdownPlugin};
fn setup_shutdown() {
let coordinator: ShutdownCoordinator = ShutdownCoordinator::new(ShutdownConfig::default());
ShutdownPlugin::init(coordinator);
}
```
## Verification
```sh
cargo run -p hyperlane-cli -- fmt --check
cargo clippy -p hyperlane-plugin-shutdown --all-features --all-targets -- -D warnings
cargo test -p hyperlane-plugin-shutdown --all-features
```
## License
This project is licensed under the MIT License. See the [LICENSE](../../LICENSE) file for details.
## Contact
For inquiries, please contact the author at [root@devhub.vip](mailto:root@devhub.vip).