Module: Async::Signals::Graceful

Defined in:
lib/async/signals/graceful.rb

Overview

Installs default signal handlers for graceful shutdown.

Ruby's built-in handling for SIGINT can bypass Thread.handle_interrupt, which makes graceful shutdown unreliable for event loops and other code that needs to defer interruption while cleaning up. This file also maps SIGTERM to Interrupt, so both termination signals follow the same graceful shutdown path when they are still using Ruby's default handler.

See https://bugs.ruby-lang.org/issues/22133 for more details.

Constant Summary collapse

SIGNALS =
["INT", "TERM"].freeze