From 22740fe3147f0c9de9fd966e1c8bab298e02effd Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Fri, 25 Feb 2022 08:08:53 +0100 Subject: Add Comms::new_message() This patch adds the Comms::new_message() function, which can be used to construct a new message with the origin automatically set correctly. When the Comms object is passed to a plugin, the plugin can use this function to automatically create a message that contains the right origin. Signed-off-by: Matthias Beyer --- crates/core/tedge_api/examples/heartbeat.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/core/tedge_api/examples') diff --git a/crates/core/tedge_api/examples/heartbeat.rs b/crates/core/tedge_api/examples/heartbeat.rs index e8d237f5..f6415897 100644 --- a/crates/core/tedge_api/examples/heartbeat.rs +++ b/crates/core/tedge_api/examples/heartbeat.rs @@ -83,7 +83,7 @@ async fn main() { let hsb = HeartbeatServiceBuilder; let (sender, mut receiver) = tokio::sync::mpsc::channel(10); - let comms = Comms::new(sender); + let comms = Comms::new("heartbeat-service".to_string(), sender); let config = toml::from_str( r#" -- cgit v1.2.3