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§
- Orchestrator
Config - Configuration for the request orchestrator.
- Orchestrator
Stats - Statistics for the orchestrator.
- Request
Orchestrator - Request orchestrator for intelligent content retrieval.
- Retrieval
Result - Result of a content retrieval operation.
Enums§
- Orchestrator
Error - Errors that can occur during orchestration.
- Retrieval
Strategy - Retrieval strategy for content requests.