Skip to main content

Building Async Applications

Graceful Shutdown

0:00
LearnStep 1/4

Signal Handling

Catching Shutdown Signals

Production apps need to handle SIGINT (Ctrl+C) and SIGTERM gracefully:

python
Note: Signal handlers work differently on Windows. Use try/except KeyboardInterrupt as a fallback.