code: async def addSignalHandlers(self):
          '''
          Register SIGTERM/SIGINT signal handlers with the ioloop to fini this object.
          '''
  
          def sigterm():
              print('Caught SIGTERM, shutting down.')
              asyncio.create_task(self.fini())
  
          def sigint():
              print('Caught SIGINT, shutting down.')
              asyncio.create_task(self.fini())
  
          loop = asyncio.get_running_loop()
          loop.add_signal_handler(signal.SIGINT, sigint)
          loop.add_signal_handler(signal.SIGTERM, sigtermync def addSignalHandlers(self):
          '''
          Register SIGTERM/SIGINT signal handlers with the ioloop to fini this object.
          '''
  
          def sigterm():
              print('Caught SIGTERM, shutting down.')
              asyncio.create_task(self.fini())
  
          def sigint():
              print('Caught SIGINT, shutting down.')
              asyncio.create_task(self.fini())
  
          loop = asyncio.get_running_loop()
          loop.add_signal_handler(signal.SIGINT, sigint)
          loop.add_signal_handler(signal.SIGTERM, sigterm)
docs: Register SIGTERM/SIGINT signal handlers with the ioloop to fini this object.