#mqtt #async #client #tokio

mqtt-async-client

An MQTT 3.1.1 client written in Rust, using async functions and tokio

9 releases

new 0.2.0 Feb 18, 2021
0.1.7 Oct 30, 2020
0.1.6 Sep 23, 2020
0.1.5 Feb 18, 2020
0.1.1 Jan 17, 2020
Download history 36/week @ 2020-10-30 40/week @ 2020-11-06 20/week @ 2020-11-13 31/week @ 2020-11-20 50/week @ 2020-11-27 36/week @ 2020-12-04 44/week @ 2020-12-11 10/week @ 2020-12-18 30/week @ 2020-12-25 23/week @ 2021-01-01 13/week @ 2021-01-08 39/week @ 2021-01-15 39/week @ 2021-01-22 23/week @ 2021-01-29 21/week @ 2021-02-05 141/week @ 2021-02-12

168 downloads per month

MIT license

68KB
1.5K SLoC

mqtt-async-client-rs

An MQTT 3.1.1 client written in Rust, using async functions and tokio.

Pull requests and Github issues welcome!

To run automated tests

Simply run cargo test.

The integration tests require an MQTT broker to run against, see the instructions in ${REPO}/tests/integration_test.rs.

Run the test command-line app

Run cargo run --example mqttc to print usage.

The test app requires an MQTT broker to run against, see the instructions in ${REPO}/tests/integration_test.rs.

Run cargo run --example mqttc -- --host localhost publish topic payload to publish payload payload to topic topic.

Run RUST_LOG="info" cargo run --example mqttc -- --host localhost subscribe topic to subscribe to topic topic and print any messages that are published to it.

Changelog

0.2.0

  • Update tokio dependency to v1.2.0.

0.1.7

  • Implement Debug for Client and ClientOptions
  • Reduce dependencies for faster and less fiddly builds: env_logger and structopt are now dev-dependencies, rustls is now optional but included by default as part of the tls feature.

0.1.6

  • Client is Send.

0.1.5

  • Correctly connect only once when automatic_connect is disabled.

0.1.4

  • Missing ping responses should cause a disconnect even when keepalive > op timeout.

  • Publish with retain flag.

0.1.3

  • Added timeouts to disconnect, and publish when QoS=0.

0.1.2

  • Enable automatic reconnects by default.

  • This tracks subscriptions and replays them after reconnecting. No publish retries yet.

Dependencies

~3.5–6.5MB
~128K SLoC