Closed glennpierce closed 6 years ago
Assuming I understood the question correctly, I found the tokio2 branch much nicer to work with API-wise
Here's a simple PING-PONG example https://gist.github.com/nanomad/1b1b9fca57b37737949fd5e1a9d3c6aa
Note that I'm publishing the reply messages in a different thread as it is a bad idea to delay the MQTT messages dequeuing (the for m in rx
loop)
Thanks. I didn't know about the Tokio2 branch. I will look at your example. Basically all I want todo is to subscribe to electrical current readings from a number of energy monitors I have. On each new current reading I want to publish the power and energy.
Yeah that's basically my use case as well. You can even remove the outer thread from my example as it is pointless for something very basic (it was a quick adaptation from my code)
Thanks @nanomad for explaining this.
Hi
The title says it all really. Is there a way I can publish from a callback. How could I pass the request object ?
Thanks