Skip to main content

DispatchRouter

Trait DispatchRouter 

Source
pub trait DispatchRouter:
    Debug
    + Send
    + Sync {
    // Required method
    fn select_worker(
        &self,
        workflow_id: &str,
        channel_name: &ChannelName,
        request: &ActivityRequest,
        candidates: &[DispatchWorker],
        excluded_worker_ids: &[String],
    ) -> Result<Option<DispatchWorker>, AionSurfaceError>;
}
Expand description

Selects a worker by invoking the channel’s configured routing function.

Required Methods§

Source

fn select_worker( &self, workflow_id: &str, channel_name: &ChannelName, request: &ActivityRequest, candidates: &[DispatchWorker], excluded_worker_ids: &[String], ) -> Result<Option<DispatchWorker>, AionSurfaceError>

Selects one worker from the supplied snapshot.

§Errors

Returns an error if routing execution fails.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§