Example!
This example starts four tortoise clients, :a
, :b
, :c
, and :d
who subscribe to the same shared topic: bar
. Notice that the client expect a broker running on localhost, on port 1883, and accept username/password less connections.
Start the example by typing MqttTest.start()
in an iex session; now one can observe the name of the receiving client change when a message is posted to the bar
-topic, using: Tortoise.publish(:a, "bar", "hello")