parameters: (self)
docstring: Run the server forever
docstring_summary: Run the server forever
docstring_tokens: Run the server forever
function: def serve_forever(self):
          '''
          Run the server forever
          '''
          self.stop_event = threading.Event()
          process.current_process()._manager_server = self
          try:
              accepter = threading.Thread(target=self.accepter)
              accepter.daemon = True
              accepter.start()
              try:
                  while not self.stop_event.is_set():
                      self.stop_event.wait(1)
              except (KeyboardInterrupt, SystemExit):
                  pass
          finally:
              if sys.stdout != sys.__stdout__: # what about stderr?
                  util.debug('resetting stdout, stderr')
                  sys.stdout = sys.__stdout__
                  sys.stderr = sys.__stderr__
              sys.exit(0)
function_tokens: def serve_forever ( self ) : self . stop_event = threading . Event ( ) process . current_process ( ) . _manager_server = self try : accepter = threading . Thread ( target = self . accepter ) accepter . daemon = True accepter . start ( ) try : while not self . stop_event . is_set ( ) : self . stop_event . wait ( 1 ) except ( KeyboardInterrupt , SystemExit ) : pass finally : if sys . stdout != sys . __stdout__ : # what about stderr? util . debug ( 'resetting stdout, stderr' ) sys . stdout = sys . __stdout__ sys . stderr = sys . __stderr__ sys . exit ( 0 )