v-module-queue 0.1.0

Veda module queue consumer runtime (without full-text / xapian stack)
Documentation
use crate::api::MStorageClient;
use crate::module::Module;

/// Lightweight module host: waits for main module via mstorage NNG, no storage / FT / xapian.
pub struct Backend {
    pub mstorage_api: MStorageClient,
}

impl Default for Backend {
    fn default() -> Self {
        Self::new()
    }
}

impl Backend {
    pub fn new() -> Self {
        let param_name = "main_module_url";
        let mstorage_api = if let Some(url) = Module::get_property(param_name) {
            MStorageClient::new(url)
        } else {
            error!("not found param {} in properties file", param_name);
            MStorageClient::new("".to_owned())
        };

        Backend { mstorage_api }
    }
}