Python class
SchedulerResult
SchedulerResult
class max.interfaces.SchedulerResult(is_done, result)
Bases: Struct, Generic[PipelineOutputType]
Structure representing the result of a scheduler operation for a specific pipeline execution.
This class encapsulates the outcome of a pipeline operation as managed by the scheduler, including both the execution status and any resulting data from the pipeline. The scheduler uses this structure to communicate the state of pipeline operations back to clients, whether the operation is still running, has completed successfully, or was cancelled.
The generic type parameter allows this result to work with different types of pipeline outputs while maintaining type safety.
-
Parameters:
-
- is_done (bool)
- result (PipelineOutputType | None)
cancelled()
classmethod cancelled()
Create a SchedulerResult representing a cancelled pipeline operation.
-
Returns:
-
A
SchedulerResultthat is done. -
Return type:
-
SchedulerResult[PipelineOutputType]
create()
classmethod create(result)
Create a SchedulerResult representing a pipeline operation with some result.
-
Parameters:
-
result (PipelineOutputType) – The pipeline output data.
-
Returns:
-
A
SchedulerResultwith a result. -
Return type:
-
SchedulerResult[PipelineOutputType]
is_done
is_done: bool
The current status of the pipeline operation from the scheduler’s perspective.
result
result: PipelineOutputType | None
The pipeline output data, if any. May be None for cancelled operations or during intermediate states of streaming operations.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!