def install_signal_handlers():
 signal.signal(signal.SIGTERM, _async_terminate)
 signal.signal(signal.SIGINT, _async_terminate)

def install_signal_handlers ( ) : signal . signal ( signal . SIGTERM , _async_terminate ) signal . signal ( signal . SIGINT , _async_terminate )
installs a signal handler for sigterm and sigint to do orderly shutdown .