Go to file
Dustin ee8ed0c644 Add basic MQTT client functionality
Naturally, we need a way to configure the MQTT connection parameters
(host, port, username, etc.).  For that, we'll use a TOML configuration
file, which is read at startup and deserialized into a structure owned
by the Session.

The Session object now has a `run` method, which establishes the MQTT
connection and then repeatedly waits for messages from the broker.  It
will continuously attempt to connect to the broker until it succeeds.
This way, if the broker is unavailable when the application starts, it
will eventually connect when it becomes available.  Once the initial
connection is established, the client will automatically reconnect if it
gets disconnected later.

Since the `run` method loops forever and never returns, we need to use a
separate Tokio task to manage it.  We keep the task handle so we can
cancel the task when the application shuts down.
2022-12-30 13:49:01 -06:00
src Add basic MQTT client functionality 2022-12-30 13:49:01 -06:00
.gitattributes Initial commit 2022-12-30 09:10:05 -06:00
.gitignore Add basic MQTT client functionality 2022-12-30 13:49:01 -06:00
Cargo.lock Add basic MQTT client functionality 2022-12-30 13:49:01 -06:00
Cargo.toml Add basic MQTT client functionality 2022-12-30 13:49:01 -06:00
rustfmt.toml Initial commit 2022-12-30 09:10:05 -06:00