churn-v2/crates/churn/src/agent.rs
kjuulh db4cc98643
All checks were successful
continuous-integration/drone/push Build is passing
feat: update with web assembly components
Signed-off-by: kjuulh <contact@kjuulh.io>
2024-12-01 22:21:17 +01:00

37 lines
668 B
Rust

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