class_docstr: Runtime to make sure that a server can asynchronously run inside a new asynchronous loop. It will make sure that the server is run forever while handling the TERMINATE signals
  to be received by the orchestrator to shutdown the server and its resources.
class_docstr_tok: ["Runtime","to","make","sure","that","a","server","can","asynchronously","run","inside","a","new","asynchronous","loop",".","It","will","make","sure","that","the","server","is","run","forever","while","handling","the","TERMINATE","signals","to","be","received","by","the","orchestrator","to","shutdown","the","server","and","its","resources","."]
code: def __exit__(self, exc_type, exc_val, exc_tb):
      if exc_type == RuntimeTerminated:
          self.logger.debug(f"{self!r} is ended")
      elif exc_type == KeyboardInterrupt:
          self.logger.debug(f"{self!r} is interrupted by user")
      elif exc_type and issubclass(exc_type, Exception):
          self.logger.error(
              f"{exc_val!r} during {self.run_forever!r}"
              + f'\n add "--quiet-error" to suppress the exception details'
              if not self.args.quiet_error
              else "",
              exc_info=not self.args.quiet_error,
          )
      try:
          self.teardown()
      except OSError:
          # OSError(Stream is closed) already
          pass
      except Exception as ex:
          self.logger.error(
              f"{ex!r} during {self.teardown!r}"
              + f'\n add "--quiet-error" to suppress the exception details'
              if not self.args.quiet_error
              else "",
              exc_info=not self.args.quiet_error,
          )
  
      # https://stackoverflow.com/a/28158006
      # return True will silent all exception stack trace here, silence is desired here as otherwise it is too
      # noisy
      #
      # doc: If an exception is supplied, and the method wishes to suppress the exception (i.e., prevent it
      # from being propagated), it should return a true value. Otherwise, the exception will be processed normally
      # upon exit from this method.
      return True
  
imports: import argparse
  import asyncio
  import signal
  import time
  from typing import TYPE_CHECKING, Optional, Union
  from jina.constants import __windows__
  from jina.excepts import PortAlreadyUsed, RuntimeTerminated
  from jina.helper import ArgNamespace, is_port_free, random_ports, send_telemetry_event
  from jina.logging.logger import JinaLogger
  from jina.parsers import set_gateway_parser
  from jina.parsers.helper import _set_gateway_uses
  from jina.serve.runtimes.gateway.composite import CompositeGateway
  from jina.serve.runtimes.gateway.gateway import BaseGateway
  from jina.serve.runtimes.gateway.grpc import GRPCGateway
  from jina.serve.runtimes.gateway.http import HTTPGateway
  from jina.serve.runtimes.gateway.websocket import WebSocketGateway
  from jina.serve.runtimes.servers import BaseServer
label_desc: Use image node_id 9 for calling the AsyncNewLoopRuntime obj's underlying member method code with example usage: obj.__exit__(exc_type, exc_val, exc_tb) and returns: True