Skip to main content

ScaleUpLeafNodeHandler

Trait ScaleUpLeafNodeHandler 

Source
pub trait ScaleUpLeafNodeHandler:
    Send
    + Sync
    + 'static {
    // Required method
    fn handle(
        &self,
        ev: ScaleUpLeafNodeEvent<'_>,
    ) -> Option<Result<ScaleUpLeafNodeEventResponse>>;
}
Expand description

Handles optional leaf rewrites after a stage’s task count is final.

Handlers are evaluated in reverse registration order. Return Ok(Some(_)) to select a replacement and stop dispatch, or Ok(None) to let earlier handlers try the same leaf. If all handlers return None, the original leaf is left unchanged. Returning an error aborts planning.

Required Methods§

Source

fn handle( &self, ev: ScaleUpLeafNodeEvent<'_>, ) -> Option<Result<ScaleUpLeafNodeEventResponse>>

Optionally replaces the leaf described by ev.

ev.task_count already accounts for the constraints and desired counts of every leaf in the stage. Implementations should use it when creating the per-task variants of the replacement plan.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ScaleUpLeafNodeHandler for Arc<dyn ScaleUpLeafNodeHandler>

Implementors§