v1.0.4
Release of v1.0.4 now allows for using wildcards when subscribing.
Thanks to @lmn for the PR.
nmqtt_sub
nmqtt_sub -t test/#
Library
import nmqtt, asyncdispatch
let ctx = newMqttCtx("nmqttClient")
ctx.set_host("test.mosquitto.org", 1883)
proc mqttSub() {.async.} =
await ctx.start()
proc on_data(topic: string, message: string) =
echo "got ", topic, ": ", message
await ctx.subscribe("test/#", 2, on_data)
asyncCheck mqttSub()
runForever()