Function tether_utils::tether_send::send
source · pub fn send(options: &SendOptions, tether_agent: &TetherAgent) -> Result<()>Examples found in repository?
examples/api.rs (line 52)
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
fn demo_send() {
let tether_agent = TetherAgentOptionsBuilder::new("demoSend")
.build()
.expect("failed to init/connect Tether Agent");
let mut count = 0;
let options = SendOptions {
plug_name: Some("dummyData".into()),
plug_topic: None,
plug_id: None,
plug_role: None,
message_payload_json: None,
use_dummy_data: true,
};
loop {
std::thread::sleep(std::time::Duration::from_secs(1));
count += 1;
println!("SEND: sending message #{}", count);
send(&options, &tether_agent).expect("failed to send");
}
}