Skip to content

eastern-oak/tjiftjaf

Repository files navigation

tjiftjaf is a Rust library implementing MQTT 3.1.1.

Features

MQTT Client

The crate provides a blocking Client and an asynchronous Client.

The latter does not require a specific runtime executor.

Take a look at the examples:

Do not use this crate

I created this project to learn more about MQTT, fuzzing, sans-io and zero-copy.

Do not rely on this crate for your own projects. It's unstable. Consider using rumqttc instead.

Fuzzer

Portions of the code are verified using fuzzing. Make sure to install cargo fuzz before running the examples.

cargo +nightly fuzz run subscribe

List all fuzz targets using:

cargo +nightly fuzz list

Benchmarks

The project uses Criterion.rs to benchmark encoding and decoding speed of packets. Run all benchmarks using:

$ cargo bench

To list all benchmarks run:

$ cargo bench -- --list

You can plot a flamegraph of a benchmark. First build the benchmark into a binary.

$ cargo bench --no-run
  ...
  Executable benches/decode-encode.rs (target/release/deps/decode_encode-9f10de3c0a084302)

Then, invoke the binary with flamegraph. This example runs only 1 benchmark that matches the string 'Publish':

$ flamegraph -- target/release/deps/decode_encode-9f10de3c0a084302 --bench Publish
...
Benchmarking decode/encode Publish: Complete (Analysis Disabled)
...
[ perf record: Captured and wrote 1264.806 MB perf.data (79730 samples) ]
writing flamegraph to "flamegraph.svg"

License

This project is licensed under the Mozilla Public License.

About

MQTT client in Rust

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages