Skip to content

v1.0.4

Compare
Choose a tag to compare
@github-actions github-actions released this 17 Oct 05:19
· 7 commits to master since this release

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()