use fundamentum_edge_proto::com::fundamentum::edge::v1::{ configuration_client::ConfigurationClient, ConfigData, UpdateData, }; use tonic::Request; async fn get_configuration() -> Result> { let mut client = ConfigurationClient::connect("http://127.0.0.1:8080").await?; let response = client.get(Request::new(())).await?; Ok(response.into_inner()) } async fn subscribe_configuration_updates() -> Result, Box> { let mut client = ConfigurationClient::connect("http://127.0.0.1:8080").await?; let mut config_update_stream = client.update_stream(Request::new(())).await?.into_inner(); let mut responses = Vec::new(); while let Some(update_data) = config_update_stream.message().await? { responses.push(update_data); } Ok(responses) } #[tokio::main] async fn main() -> Result<(), Box> { let get_config_response = get_configuration().await?; println!("Get Config Response = {get_config_response:?}"); let config_updates = subscribe_configuration_updates().await?; println!("Config updates = {config_updates:?}"); Ok(()) }