#How to add an actor that uses erlang functions in a surpevisor
1 messages · Page 1 of 1 (latest)
It seems like you want to send it to the actor instead
My first guess is that there's a bug in the FFI
I am not sure, but it looks as if you start the emqtt client in your builder function, meaning that the parent is the supervisor process. I am wondering if you maybe should use the actor.new_with_initializerfunction instead and put the emqtt start in that start function. In that case your actor will be the parent instead.
It seems like you’re starting that process unsupervised though
The API seems strange, it always sends messages to the parent? That seems like it forces no supervision
If you just want to use MQTT, check out https://hexdocs.pm/spoke_mqtt_actor/index.html. But if you want to explore and build, then carry on 🙂
There's also https://github.com/jhillyerd/gemqtt, which wraps emqtt. Were you able to solve the emqtt dependency issue mentioned in the README of that repo, or have they fixed it upstream? That was (funnily enough), one of the things that originally motivated me to write a pure Gleam implementation.