class_docstr: Interface for task schedulers.
class_docstr_tok: ["Interface","for","task","schedulers","."]
docstr: Schedules task execution and returns the results of execution.
  
  This method blocks until task execution completes (successfully or not) or
  until explicitly cancelled by a call to `cancel`. When cancelled, `schedule`
  is expected to stop any ongoing work, clean up and return as soon as
  possible. Note that `cancel` will be invoked from a different thread than
  `schedule` and hence the concrete implementations must be thread safe. It's
  technically possible for `cancel` to be invoked before `schedule`; scheduler
  implementations should handle this case by returning from `schedule`
  immediately.
docstr_tok: ["Schedules","task","execution","and","returns","the","results","of","execution",".","This","method","blocks","until","task","execution","completes","(","successfully","or","not",")","or","until","explicitly","cancelled","by","a","call","to","`","cancel","`",".","When","cancelled",",","`","schedule","`","is","expected","to","stop","any","ongoing","work",",","clean","up","and","return","as","soon","as","possible",".","Note","that","`","cancel","`","will","be","invoked","from","a","different","thread","than","`","schedule","`","and","hence","the","concrete","implementations","must","be","thread","safe",".","It's","technically","possible","for","`","cancel","`","to","be","invoked","before","`","schedule","`",";","scheduler","implementations","should","handle","this","case","by","returning","from","`","schedule","`","immediately","."]
code: def schedule(self) -> TaskSchedulerResult:
      """Schedules task execution and returns the results of execution.
  
      This method blocks until task execution completes (successfully or not) or
      until explicitly cancelled by a call to `cancel`. When cancelled, `schedule`
      is expected to stop any ongoing work, clean up and return as soon as
      possible. Note that `cancel` will be invoked from a different thread than
      `schedule` and hence the concrete implementations must be thread safe. It's
      technically possible for `cancel` to be invoked before `schedule`; scheduler
      implementations should handle this case by returning from `schedule`
      immediately.
      """
  
imports: import abc
  from typing import Callable, Dict, Generic, List, Optional, Type, TypeVar, Union
  import attr
  from tfx import types
  from tfx.orchestration import metadata
  from tfx.orchestration.experimental.core import task
  from tfx.proto.orchestration import execution_result_pb2
  from tfx.proto.orchestration import pipeline_pb2
  from tfx.utils import status
label_desc: Use image node_id 2 for calling the TaskScheduler obj's underlying member method code with example usage: obj.schedule() without return types