#mqtt #iot #rpc #service #response-pattern

mqtt-service

This crates provide a convenient support for the MQTT Response-Pattern. It uses the rumqttc library to connect to the MQTT broker.

5 releases (breaking)

0.5.0 Oct 2, 2024
0.4.0 Sep 25, 2024
0.3.0 Sep 2, 2024
0.2.0 Jun 22, 2024
0.1.0 Jun 22, 2024

#1922 in Network programming


Used in 2 crates

MIT license

14KB
300 lines

stable pipeline dev/1 pipeline docs crates.io

mqtt-service

This crate provides a convenient support for the MQTT Response-Pattern. It uses the rumqttc library to connect to the MQTT broker.

Note: this crate is feature complete, and few changes are expected.

How to use

cargo add mqtt-service
let connection = mqtt_service::Connection::new("name-of-the-client", "localhost", 1883);
let r = connection.call_service("name/of/service" "Some data");
let res = futures::executor::block_on(r.unwrap());
println!("Result is '{res:?}'");

Dependencies

~5–13MB
~156K SLoC