Module orchestrator

Module orchestrator 

Source
Expand description

Request orchestration for intelligent content retrieval.

This module provides a high-level orchestrator that coordinates multiple subsystems (peer selection, content routing, reputation, network diagnostics, circuit breakers) to retrieve content efficiently with automatic retries and fallbacks.

§Example

use chie_core::orchestrator::{RequestOrchestrator, RetrievalStrategy, OrchestratorConfig};
use chie_core::qos::Priority;

async fn example() -> Result<(), Box<dyn std::error::Error>> {
    let config = OrchestratorConfig::default();
    let orchestrator = RequestOrchestrator::new(config);

    // Request content with automatic peer selection and retries
    // Priority is optional - None will bypass QoS
    let result = orchestrator.retrieve_content(
        "QmExample",
        RetrievalStrategy::BestEffort,
        Some(Priority::High),
    ).await?;

    println!("Retrieved {} bytes from {} peers",
        result.total_bytes, result.peers_used.len());
    Ok(())
}

Structs§

OrchestratorConfig
Configuration for the request orchestrator.
OrchestratorStats
Statistics for the orchestrator.
RequestOrchestrator
Request orchestrator for intelligent content retrieval.
RetrievalResult
Result of a content retrieval operation.

Enums§

OrchestratorError
Errors that can occur during orchestration.
RetrievalStrategy
Retrieval strategy for content requests.