use super::key_family::RegistryKeyFamilyCheckpoint;
use std::{collections::BTreeMap, sync::Mutex};
#[derive(Clone, Debug, Eq, PartialEq)]
pub struct SubnetCatalogProgress {
pub endpoint: String,
pub query_call_count: u64,
pub phase: SubnetCatalogProgressPhase,
}
#[derive(Clone, Debug, Eq, PartialEq)]
pub enum SubnetCatalogProgressPhase {
EndpointStarted,
Pinned {
registry_version: u64,
},
History {
registry_version: u64,
through_version: u64,
reused: bool,
},
Record {
registry_version: u64,
key: String,
completed: bool,
},
Retry {
method: &'static str,
next_attempt: u8,
delay_millis: u64,
},
}
#[derive(Default)]
pub struct RegistryAcquisition {
pub(super) history: Mutex<BTreeMap<(String, String), RegistryKeyFamilyCheckpoint>>,
pub(crate) progress: Option<Box<dyn Fn(SubnetCatalogProgress) + Send + Sync>>,
}