crates/turborepo-signals/README.md
Signal handling infrastructure. Provides a mechanism to subscribe to signals and coordinate graceful shutdown across multiple components.
Signal source (e.g., SIGINT)
└── SignalHandler
├── Subscribers notified
└── SubscriberGuard ensures completion
Key types:
SignalHandler - Central coordinator for signal eventsSignalSubscriber - Receives notification when signal occursSubscriberGuard - Held until subscriber finishes cleanupSubscribers are notified when a signal occurs or when close() is called. The first signal starts cleanup; subsequent signals are retained so shutdown code can reliably detect force-shutdown requests. The guard pattern ensures all subscribers complete their cleanup before shutdown proceeds.