mocra-core 0.4.0

The mocra crawler framework runtime: errors, cache, utilities, domain models, downloader, data-plane queue, coordination, scheduler and engine.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::common::model::config::Config;
use async_trait::async_trait;
use tokio::sync::watch;

#[async_trait]
pub trait ConfigProvider: Send + Sync {
    /// Load the initial configuration
    async fn load_config(&self) -> Result<Config, String>;

    /// Watch for configuration changes.
    /// Returns a watch::Receiver that yields the latest Config.
    async fn watch(&self) -> Result<watch::Receiver<Config>, String>;
}

pub mod file;
pub mod redis;