agentmux_srv/sagas/
teardown_hooks.rs1use std::sync::Arc;
8
9use crate::backend::blockcontroller::Controller;
10use crate::backend::teardown_hooks::TeardownHooks;
11
12struct Hooks;
13
14pub(crate) fn hooks() -> Arc<dyn TeardownHooks> {
16 Arc::new(Hooks)
17}
18
19pub(crate) fn install() {
21 crate::backend::teardown_hooks::install(hooks());
22}
23
24impl TeardownHooks for Hooks {
25 fn stop_now(&self, block_id: &str, graceful: bool) -> Result<(), String> {
26 super::agent_teardown::stop_now(block_id, graceful)
27 }
28
29 fn replace_now(&self, ctrl: &dyn Controller) -> Result<(), String> {
30 super::agent_teardown::replace_now(ctrl)
31 }
32
33 fn discard(&self, block_id: &str) {
34 super::agent_teardown::discard(block_id)
35 }
36}