code: def shutdown(self):
          
          if self.cycle is None or self.cycle.response_complete:
              self.transport.close()
          else:
              self.cycle.keep_alive = False
docs: Called by the server to commence a graceful shutdown.