Trait Learner

View as Markdown

Generated from cargo doc --no-deps -p nemo-relay -p nemo-relay-adaptive -p nemo-relay-ffi.

pub trait Learner:
    Send
    + Sync
    + 'static {
    // Required method
    fn process_run<'a>(
        &'a self,
        run: &'a RunRecord,
        backend: &'a dyn StorageBackendDyn,
        hot_cache: &'a Arc<RwLock<HotCache>>,
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>;
}

Background learner that updates adaptive state from observed runs.

Required Methods

process_run

fn process_run<'a>(
    &'a self,
    run: &'a RunRecord,
    backend: &'a dyn StorageBackendDyn,
    hot_cache: &'a Arc<RwLock<HotCache>>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'a>>

Process one observed run and update backend state plus the hot cache.

Parameters
  • run: Telemetry record to learn from.
  • backend: Storage backend used to persist learner state.
  • hot_cache: Shared in-memory cache to refresh with the latest results.
Returns

A future that resolves when the learner has finished processing the run.

Implementors

impl Learner for AcgLearner

impl Learner for AcgLearner

impl Learner for ToolParallelismLearner

impl Learner for ToolParallelismLearner

impl Learner for LatencySensitivityLearner

impl Learner for LatencySensitivityLearner