class_docstr: Task generator for executing an async pipeline.
  
  Calling `generate` is not thread-safe. Concurrent calls to `generate` should
  be explicitly serialized. Since MLMD may be updated upon call to `generate`,
  it's also not safe to call `generate` on different instances of this class
  where the instances refer to the same MLMD db and the same pipeline IR.
class_docstr_tok: ["Task","generator","for","executing","an","async","pipeline",".","Calling","`","generate","`","is","not","thread-safe",".","Concurrent","calls","to","`","generate","`","should","be","explicitly","serialized",".","Since","MLMD","may","be","updated","upon","call","to","`","generate","`",",","it","'s","also","not","safe","to","call","`","generate","`","on","different","instances","of","this","class","where","the","instances","refer","to","the","same","MLMD","db","and","the","same","pipeline","IR","."]
docstr: Generates tasks for all executable nodes in the async pipeline.
  
  The returned tasks must have `exec_task` populated. List may be empty if no
  nodes are ready for execution.
  
  Args:
    pipeline_state: The `PipelineState` object associated with the pipeline
      for which to generate tasks.
  
  Returns:
    A `list` of tasks to execute.
docstr_tok: ["Generates","tasks","for","all","executable","nodes","in","the","async","pipeline",".","The","returned","tasks","must","have","`","exec_task","`","populated",".","List","may","be","empty","if","no","nodes","are","ready","for","execution",".","Args",":","pipeline_state",":","The","`","PipelineState","`","object","associated","with","the","pipeline","for","which","to","generate","tasks",".","Returns",":","A","`","list","`","of","tasks","to","execute","."]
code: def generate(
      self, pipeline_state: pstate.PipelineState
  ) -> List[task_lib.Task]:
      """Generates tasks for all executable nodes in the async pipeline.
  
      The returned tasks must have `exec_task` populated. List may be empty if no
      nodes are ready for execution.
  
      Args:
        pipeline_state: The `PipelineState` object associated with the pipeline
          for which to generate tasks.
  
      Returns:
        A `list` of tasks to execute.
      """
      return _Generator(
          self._mlmd_connection_manager,
          pipeline_state,
          self._is_task_id_tracked_fn,
          self._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 2 for calling the AsyncPipelineTaskGenerator obj's underlying member method code with example usage: obj.generate(pipeline_state) and returns: _Generator