Crate bye

Source
Expand description

bye: graceful shutdown and USR1 zero-downtime upgrade helpers.

  • Bye manages a CancellationToken broadcast + a TaskTracker.
  • Bye::new_with_signals() listens for TERM/INT/QUIT -> drain, USR1 -> fork+exec self and wait for child ready().
  • ready() tells the parent (or your process manager) that the service is ready.
  • systemd_tcp_listener(port) uses socket activation if available.

Structs§

Bye
Main struct to manage graceful shutdown and task tracking Cloning this struct allows sharing the shutdown signal and task tracking capabilities across different parts of the application. When a shutdown is initiated, all tracked tasks will be awaited before the application fully exits.

Functions§

ready
Notifies the system that the service is ready.
systemd_ports
systemd_tcp_listener
Creates a TCP listener that uses systemd socket activation if available.
try_pid_file