Hi all,
I'm writing a system where I would like to process events coming from an MQTT server, through the Tortoise connection, into my regular Elixir code. From my regular Elixir code I would like to send commands back to the MQTT server.
So this would look something like this:
+----+ +--------+ +------+
|mqtt|<--->|tortoise|<--->|elixir|
+--+-+ +--------+ +------+
However, I notice that it doesn't seem possible to send messages from the application to the Tortoise connection handler.
I do know that you can manually send events directly to the connection using Tortoise.publish/3, but that, i think, splits the code concerned with MQTT communication in two. It would be nicer if all that logic would be contained within a single module.
Currently the diagram looks more like this:
+----+ +--------+ +------+
|mqtt|<-------->|tortoise|---------->|elixir|
+--+-+ +--------+ +-+----+
^ |
+-----------------------------------+
So perhaps adding support for handle_info/2 or something would be useful?
This is all under the assumption that I understand what I'm doing. I might as well be missing something?
Hi all,
I'm writing a system where I would like to process events coming from an MQTT server, through the Tortoise connection, into my regular Elixir code. From my regular Elixir code I would like to send commands back to the MQTT server.
So this would look something like this:
However, I notice that it doesn't seem possible to send messages from the application to the Tortoise connection handler.
I do know that you can manually send events directly to the connection using
Tortoise.publish/3, but that, i think, splits the code concerned with MQTT communication in two. It would be nicer if all that logic would be contained within a single module.Currently the diagram looks more like this:
So perhaps adding support for
handle_info/2or something would be useful?This is all under the assumption that I understand what I'm doing. I might as well be missing something?