def __init__(self, args: 'argparse.Namespace'):
    super().__init__()
    self.args = args
    self.name = (self.args.name or self.__class__.__name__)
    self.logger = JinaLogger(self.name, **vars(self.args))
    if (self.args.runtime_backend == RuntimeBackendType.THREAD):
        self.logger.warning(f' Using Thread as runtime backend is not recommended for production purposes. It is just supposed to be used for easier debugging. Besides the performance considerations, it isspecially dangerous to mix `Executors` running in different types of `RuntimeBackends`.')
    self._envs = {'JINA_POD_NAME': self.name, 'JINA_LOG_ID': self.args.identity}
    if self.args.quiet:
        self._envs['JINA_LOG_CONFIG'] = 'QUIET'
    if self.args.env:
        self._envs.update(self.args.env)
    self.runtime_cls = self._get_runtime_cls()
    self._timeout_ctrl = self.args.timeout_ctrl
    self._set_ctrl_adrr()
    test_worker = {RuntimeBackendType.THREAD: threading.Thread, RuntimeBackendType.PROCESS: multiprocessing.Process}.get(getattr(args, 'runtime_backend', RuntimeBackendType.THREAD))()
    self.is_ready = _get_event(test_worker)
    self.is_shutdown = _get_event(test_worker)
    self.cancel_event = _get_event(test_worker)
    self.is_started = _get_event(test_worker)
    self.ready_or_shutdown = ConditionalEvent(getattr(args, 'runtime_backend', RuntimeBackendType.THREAD), events_list=[self.is_ready, self.is_shutdown])
    self.worker = {RuntimeBackendType.THREAD: threading.Thread, RuntimeBackendType.PROCESS: multiprocessing.Process}.get(getattr(args, 'runtime_backend', RuntimeBackendType.THREAD))(target=run, kwargs={'args': args, 'name': self.name, 'envs': self._envs, 'is_started': self.is_started, 'is_shutdown': self.is_shutdown, 'is_ready': self.is_ready, 'cancel_event': self.cancel_event, 'runtime_cls': self.runtime_cls})
    self.daemon = self.args.daemon
def __init__(self, args: 'argparse.Namespace'):
    super().__init__()
    self.args = args
    self.name = (self.args.name or self.__class__.__name__)
    self.logger = JinaLogger(self.name, **vars(self.args))
    if (self.args.runtime_backend == RuntimeBackendType.THREAD):
        self.logger.warning(f' Using Thread as runtime backend is not recommended for production purposes. It is just supposed to be used for easier debugging. Besides the performance considerations, it isspecially dangerous to mix `Executors` running in different types of `RuntimeBackends`.')
    self._envs = {'JINA_POD_NAME': self.name, 'JINA_LOG_ID': self.args.identity}
    if self.args.quiet:
        self._envs['JINA_LOG_CONFIG'] = 'QUIET'
    if self.args.env:
        self._envs.update(self.args.env)
    self.runtime_cls = self._get_runtime_cls()
    self._timeout_ctrl = self.args.timeout_ctrl
    self._set_ctrl_adrr()
    test_worker = {RuntimeBackendType.THREAD: threading.Thread, RuntimeBackendType.PROCESS: multiprocessing.Process}.get(getattr(args, 'runtime_backend', RuntimeBackendType.THREAD))()
    self.is_ready = _get_event(test_worker)
    self.is_shutdown = _get_event(test_worker)
    self.cancel_event = _get_event(test_worker)
    self.is_started = _get_event(test_worker)
    self.ready_or_shutdown = ConditionalEvent(getattr(args, 'runtime_backend', RuntimeBackendType.THREAD), events_list=[self.is_ready, self.is_shutdown])
    self.worker = {RuntimeBackendType.THREAD: threading.Thread, RuntimeBackendType.PROCESS: multiprocessing.Process}.get(getattr(args, 'runtime_backend', RuntimeBackendType.THREAD))(target=run, kwargs={'args': args, 'name': self.name, 'envs': self._envs, 'is_started': self.is_started, 'is_shutdown': self.is_shutdown, 'is_ready': self.is_ready, 'cancel_event': self.cancel_event, 'runtime_cls': self.runtime_cls})
    self.daemon = self.args.daemon