Skip to main content

Python class

SchedulerResult

SchedulerResult

class max.interfaces.SchedulerResult(is_done, result)

source

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

source

Create a SchedulerResult representing a cancelled pipeline operation.

Returns:

A SchedulerResult that is done.

Return type:

SchedulerResult[PipelineOutputType]

create()

classmethod create(result)

source

Create a SchedulerResult representing a pipeline operation with some result.

Parameters:

result (PipelineOutputType) – The pipeline output data.

Returns:

A SchedulerResult with a result.

Return type:

SchedulerResult[PipelineOutputType]

is_done

is_done: bool

source

The current status of the pipeline operation from the scheduler’s perspective.

result

result: PipelineOutputType | None

source

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