class_docstr: Generator implementation class for AsyncPipelineTaskGenerator.
class_docstr_tok: ["Generator","implementation","class","for","AsyncPipelineTaskGenerator","."]
code: def __init__(
      self,
      mlmd_connection_manager: mlmd_cm.MLMDConnectionManager,
      pipeline_state: pstate.PipelineState,
      is_task_id_tracked_fn: Callable[[task_lib.TaskId], bool],
      service_job_manager: service_jobs.ServiceJobManager,
  ):
      self._mlmd_connection_manager = mlmd_connection_manager
      self._mlmd_handle = mlmd_connection_manager.primary_mlmd_handle
      pipeline = pipeline_state.pipeline
      if (
          pipeline.execution_mode
          != pipeline_pb2.Pipeline.ExecutionMode.ASYNC
      ):
          raise ValueError(
              "AsyncPipelineTaskGenerator should be instantiated with a pipeline "
              "proto having execution mode `ASYNC`, not `{}`".format(
                  pipeline.execution_mode
              )
          )
      self._pipeline_state = pipeline_state
      self._pipeline = pipeline
      self._is_task_id_tracked_fn = is_task_id_tracked_fn
      self._service_job_manager = service_job_manager
  
imports: import sys
  import traceback
  from typing import Callable, List, Optional
  from absl import logging
  from tfx.orchestration import metadata
  from tfx.orchestration import node_proto_view
  from tfx.orchestration.experimental.core import constants
  from tfx.orchestration.experimental.core import event_observer
  from tfx.orchestration.experimental.core import mlmd_state
  from tfx.orchestration.experimental.core import pipeline_state
  from tfx.orchestration.experimental.core import service_jobs
  from tfx.orchestration.experimental.core import task
  from tfx.orchestration.experimental.core import task_gen
  from tfx.orchestration.experimental.core import task_gen_utils
  from tfx.orchestration import mlmd_connection_manager
  from tfx.orchestration.portable.input_resolution import exceptions
  from tfx.proto.orchestration import pipeline_pb2
  from tfx.utils import status
  from ml_metadata.proto import metadata_store_pb2
label_desc: Use image node_id 1 to create a new _Generator object  with example: obj = _Generator(mlmd_connection_manager, pipeline_state, is_task_id_tracked_fn, service_job_manager)