feat: add agent
All checks were successful
continuous-integration/drone/push Build is passing

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
2024-11-24 00:53:43 +01:00
parent 7487e7336e
commit d1e9eb9eb5
8 changed files with 418 additions and 11 deletions

18
crates/churn/src/agent.rs Normal file
View File

@@ -0,0 +1,18 @@
use agent_state::AgentState;
use refresh::AgentRefresh;
mod agent_state;
mod refresh;
pub async fn execute(host: impl Into<String>) -> anyhow::Result<()> {
let state = AgentState::new().await?;
notmad::Mad::builder()
.add(AgentRefresh::new(&state, host))
.cancellation(Some(std::time::Duration::from_secs(2)))
.run()
.await?;
Ok(())
}