first commit

This commit is contained in:
2023-03-14 11:29:44 +07:00
commit b215f1a3ac
19 changed files with 1061 additions and 0 deletions

11
examples/01_publish.jl Normal file
View File

@@ -0,0 +1,11 @@
using Mosquitto, Dates
# connect to a broker, also start loop if Threads.nthreads() > 1
client = Client("test.mosquitto.org")
topic = "test/julia"
message = "Hello World from Julia, send on $(now(UTC)) using the Mosquitto wrapper https://github.com/denglerchr/Mosquitto.jl"
publish(client, topic, message; retain = true)
!client.status.loop_status && loop(client; ntimes = 2)
disconnect(client)