Python class
SchedulerResult
SchedulerResult
class max.serve.scheduler_result.SchedulerResult(is_done, result)
Bases: Struct, Generic[PipelineOutputType]
Structure representing the result of a scheduler operation.
Encapsulates the outcome of a pipeline operation as managed by the scheduler, including both the execution status and any resulting data. 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.
-
Parameters:
-
- is_done (bool)
- result (PipelineOutputType | None)
cancelled()
classmethod cancelled()
Creates a SchedulerResult representing a cancelled operation.
-
Returns:
-
A
SchedulerResultwithis_done=Trueand no result. -
Return type:
-
SchedulerResult[PipelineOutputType]
create()
classmethod create(result)
Creates a SchedulerResult wrapping a pipeline output.
-
Parameters:
-
result (PipelineOutputType) – The pipeline output data.
-
Returns:
-
A
SchedulerResultreflecting the output’s completion state. -
Return type:
-
SchedulerResult[PipelineOutputType]
is_done
is_done: bool
Whether the pipeline operation is complete.
result
result: PipelineOutputType | None
The pipeline output data, if any. None for cancelled operations or
intermediate streaming states.
Was this page helpful?
Thank you! We'll create more content like this.
Thank you for helping us improve!