Skip to main content

Crate tsunagu

Crate tsunagu 

Source
Expand description

Tsunagu (繋ぐ) — service/daemon IPC framework.

Provides reusable patterns for daemon lifecycle management:

  • SocketPath: XDG-compliant Unix socket and PID file path resolution
  • DaemonProcess: PID file management, staleness detection, and cleanup
  • HealthCheck: standardized health/liveness/readiness responses

§Quick Start

use tsunagu::{DaemonProcess, HealthCheck, SocketPath};

// Resolve paths for your app
let sock = SocketPath::for_app("myapp");
let pid = SocketPath::pid_file("myapp");
assert!(sock.to_string_lossy().contains("myapp"));

// Health check response
let hc = HealthCheck::healthy("myapp", "0.1.0");
assert!(hc.is_healthy());

Re-exports§

pub use daemon::DaemonProcess;
pub use daemon::ProcessChecker;
pub use daemon::SystemProcessChecker;
pub use error::TsunaguError;
pub use health::HealthCheck;
pub use health::HealthCheckBuilder;
pub use health::HealthChecker;
pub use health::HealthStatus;
pub use health::ParseHealthStatusError;
pub use health::SimpleHealthChecker;
pub use shutdown::Shutdown;
pub use shutdown::ShutdownController;
pub use socket::SocketPath;

Modules§

daemon
error
health
shutdown
Graceful shutdown coordination for long-running daemons.
socket