Compare commits

..

No commits in common. "ab75252e6b9a7846ded0a42f186f5eacddd196fb" and "a225ec690ee146cb2509c6c58bc149b7810c72c0" have entirely different histories.

4 changed files with 7 additions and 30 deletions

View File

@ -21,7 +21,6 @@ async fn main() -> Result<()>{
// config update channel
let (tx, mut rx) = mpsc::channel::<ApiConfig>(1);
// futures
// todo : rewrite with spawn
let config_fut = init_config_grub_mechanism(&tx);
let grub_fut = init_api_grub_mechanism(config, &mut rx);

View File

@ -3,7 +3,7 @@
use anyhow::{Error, Result};
use integr_structs::api::ApiConfig;
use tokio::time::{sleep, Duration};
use tokio::time::{sleep, Instant};
use tokio::net::UnixStream;
use std::env;
use tokio::sync::mpsc::Receiver;
@ -31,16 +31,15 @@ pub async fn init_delivery_mech(rx: ConfigGateway) -> Result<()> {
match UnixSocketConsumer::ApiGrubber.get_stream_object().await {
Ok(socket) => {
socket.try_write(to_string_pretty(&config)?.as_bytes())?;
info!("New api config was pulled");
},
Err(er) => {
error!("Cannot coonect to ApiGrubber Unix-Socket due to {er}");
}
}
sleep(Duration::from_secs(3)).await;
}
// let api_sock = UnixSocketConsumer::ApiGrubber.get_stream_object().await?;
// let preproc_sock = UnixSocketConsumer::Preproc.get_stream_object().await?;
Ok(())
}
impl UnixSocketConsumer {
@ -53,13 +52,12 @@ impl UnixSocketConsumer {
}
}
// async fn check_unix_socket_file(path: &str) -> bool {
// std::path::Path::new(path).exists()
// }
async fn check_unix_socket_file(path: &str) -> bool {
std::path::Path::new(path).exists()
}
#[cfg(test)]
#[cfg(tests)]
mod delivery_unittests {
#[allow(unused_imports)]
use super::*;
use tokio::test;

View File

@ -10,6 +10,7 @@ use tokio::sync::mpsc;
use log::{info, error};
use integration::init_integration_mech;
use delivery::init_delivery_mech;
use tokio::task::JoinHandle;
use std::sync::Arc;
// Arch :

View File

@ -1,21 +0,0 @@
{
"id" : 1 ,
"template" :
[{
"id" :"conference",
"name" : "Conference",
"url" : "https://$ip_address/api/v1/conferences",
"measure" :
[
"total", "number", "description",
"shutdown", "startTime", "stopTime",
"participants_total", "participants_online"
]
}],
"ip_address" : "127.0.0.1:8081",
"login" : "",
"pass" : "" ,
"api_key" : "908c709827bd40n98r7209837x98273",
"period" : "10",
"timeout" : "2"
}