pub trait RouteTasksHandler:
Send
+ Sync
+ 'static {
// Required method
fn handle(
&self,
ev: RouteTasksEvent<'_>,
) -> Option<Result<RouteTasksEventResponse>>;
}Expand description
Optionally assigns a stage’s task slots to worker URLs.
Handlers are evaluated in reverse registration order. Return Some(Ok(_)) to select a
complete routing response and stop dispatch, or None to defer to earlier handlers. If every
handler returns None, the coordinator assigns the tasks round-robin, from a randomized worker
offset. Returning Some(Err(_)) aborts execution before tasks are submitted.
Required Methods§
Sourcefn handle(
&self,
ev: RouteTasksEvent<'_>,
) -> Option<Result<RouteTasksEventResponse>>
fn handle( &self, ev: RouteTasksEvent<'_>, ) -> Option<Result<RouteTasksEventResponse>>
Optionally assigns the tasks described by ev to specific worker URLs.
Return None when this handler does not apply. A successful response must provide exactly
one URL for every task, in task-index order.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".