Skip to main content

Python class

SchedulerResult

SchedulerResult

class max.serve.scheduler_result.SchedulerResult(is_done, result)

source

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()

source

Creates a SchedulerResult representing a cancelled operation.

Returns:

A SchedulerResult with is_done=True and no result.

Return type:

SchedulerResult[PipelineOutputType]

create()

classmethod create(result)

source

Creates a SchedulerResult wrapping a pipeline output.

Parameters:

result (PipelineOutputType) – The pipeline output data.

Returns:

A SchedulerResult reflecting the output’s completion state.

Return type:

SchedulerResult[PipelineOutputType]

is_done

is_done: bool

source

Whether the pipeline operation is complete.

result

result: PipelineOutputType | None

source

The pipeline output data, if any. None for cancelled operations or intermediate streaming states.