summaryrefslogtreecommitdiffstats
path: root/crates/core/tedge_api/examples
diff options
context:
space:
mode:
authorMatthias Beyer <matthias.beyer@ifm.com>2022-02-25 08:08:53 +0100
committerMatthias Beyer <matthias.beyer@ifm.com>2022-03-04 15:03:53 +0100
commit22740fe3147f0c9de9fd966e1c8bab298e02effd (patch)
tree244689a4a5b7ba286bd6c59e4268fb8d1162938d /crates/core/tedge_api/examples
parent9818249ea0f89e4fb71f702a9c00c9f4e998fb0b (diff)
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 <matthias.beyer@ifm.com>
Diffstat (limited to 'crates/core/tedge_api/examples')
-rw-r--r--crates/core/tedge_api/examples/heartbeat.rs2
1 files changed, 1 insertions, 1 deletions
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#"