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 __init__(
      self,
      args: "argparse.Namespace",
      cancel_event: Optional[
          Union[
              "asyncio.Event",
              "multiprocessing.Event",
              "threading.Event",
          ]
      ] = None,
      signal_handlers_installed_event: Optional[
          Union[
              "asyncio.Event",
              "multiprocessing.Event",
              "threading.Event",
          ]
      ] = None,
      req_handler_cls=None,
      gateway_load_balancer: bool = False,
      **kwargs,
  ):
      self.req_handler_cls = req_handler_cls
      self.gateway_load_balancer = gateway_load_balancer
      self.args = args
      if args.name:
          self.name = f"{args.name}/{self.__class__.__name__}"
      else:
          self.name = self.__class__.__name__
      self.logger = JinaLogger(self.name, **vars(self.args))
      self._loop = asyncio.new_event_loop()
      asyncio.set_event_loop(self._loop)
      self.is_cancel = cancel_event or asyncio.Event()
      self.is_signal_handlers_installed = (
          signal_handlers_installed_event or asyncio.Event()
      )
  
      self.logger.debug(f"Setting signal handlers")
  
      if not __windows__:
  
          def _cancel(sig):
              def _inner_cancel(*args, **kwargs):
                  self.logger.debug(f"Received signal {sig.name}")
                  self.is_cancel.set(),
  
              return _inner_cancel
  
          for sig in HANDLED_SIGNALS:
              self._loop.add_signal_handler(
                  sig, _cancel(sig), sig, None
              )
      else:
  
          def _cancel(signum, frame):
              self.logger.debug(f"Received signal {signum}")
              self.is_cancel.set(),
  
          for sig in HANDLED_SIGNALS:
              signal.signal(sig, _cancel)
  
      self.logger.debug(f"Signal handlers already set")
      self.is_signal_handlers_installed.set()
      self._start_time = time.time()
      self._loop.run_until_complete(self.async_setup())
      self._send_telemetry_event(event="start")
  
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 1 to create a new AsyncNewLoopRuntime object  with example: obj = AsyncNewLoopRuntime(args, cancel_event, signal_handlers_installed_event, req_handler_cls, gateway_load_balancer)