def signal_handler(signal, frame):
 logging.warning('Caught signal: {0}'.format(signal))
 IOLoop.instance().add_callback(shutdown)

def signal_handler ( signal , frame ) : logging . warning ( 'Caught signal: {0}' . format ( signal ) ) IOLoop . instance ( ) . add_callback ( shutdown )
signal handler for graceful shutdown .