refact: Discovery callback takes a closure and fix git dependency hash
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use async_trait::async_trait;
|
||||
use harmony_inventory_agent::local_presence::DiscoveryEvent;
|
||||
use log::info;
|
||||
use log::{debug, info};
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
use crate::{
|
||||
@@ -45,7 +45,13 @@ impl<T: Topology> Interpret<T> for DiscoverInventoryAgentInterpret {
|
||||
) -> Result<Outcome, InterpretError> {
|
||||
harmony_inventory_agent::local_presence::discover_agents(
|
||||
self.score.discovery_timeout,
|
||||
on_discover_event,
|
||||
|event: DiscoveryEvent| {
|
||||
println!("Discovery event {event:?}");
|
||||
match event {
|
||||
DiscoveryEvent::ServiceResolved(service) => info!("Found instance {service:?}"),
|
||||
_ => debug!("Unhandled event {event:?}"),
|
||||
}
|
||||
},
|
||||
);
|
||||
todo!()
|
||||
}
|
||||
@@ -66,7 +72,3 @@ impl<T: Topology> Interpret<T> for DiscoverInventoryAgentInterpret {
|
||||
todo!()
|
||||
}
|
||||
}
|
||||
|
||||
fn on_discover_event(event: &DiscoveryEvent) {
|
||||
info!("got discovery event {event:?}");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user