churn-v2/crates/churn/src/agent.rs
kjuulh ee323e99e8
All checks were successful
continuous-integration/drone/push Build is passing
feat: add discovery
Signed-off-by: kjuulh <contact@kjuulh.io>
2024-11-24 17:12:15 +01:00

26 lines
528 B
Rust

use agent_state::AgentState;
use event_handler::EventHandler;
use refresh::AgentRefresh;
pub use config::setup_config;
mod agent_state;
mod config;
mod discovery_client;
mod event_handler;
mod grpc_client;
mod refresh;
pub async fn execute() -> anyhow::Result<()> {
let state = AgentState::new().await?;
notmad::Mad::builder()
.add(AgentRefresh::new(&state))
.add(EventHandler::new(&state))
.cancellation(Some(std::time::Duration::from_secs(2)))
.run()
.await?;
Ok(())
}