Crates.io | switchboard-node-health |
lib.rs | switchboard-node-health |
version | 0.1.0 |
source | src |
created_at | 2024-01-04 14:46:12.602812 |
updated_at | 2024-01-04 14:46:12.602812 |
description | Healthcheck service for Switchboard services |
homepage | https://switchboard.xyz |
repository | |
max_upload_size | |
id | 1088698 |
size | 6,589 |
Healthcheck service for Switchboard services
Run the following Cargo command in your project directory:
cargo add switchboard-node-health
Or add the following line to your Cargo.toml:
[dependencies]
switchboard-node-health = "0.1.0"
use switchboard_node_health::SwitchboardHealth;
async fn main() {
let health = SwitchboardHealth::get_or_init().await;
// When service is healthy
health.set_is_ready().await;
// When service is degraded / shutting down
health.set_is_not_ready().await;
}