Replies: 1 comment
-
Thanks for the thoughtful feedback. Glad you are finding value in the MQTT support. Before addressing your specific points, it could be useful to state the goals of the two layers that are there:
Our MQTT.js implementation is not a full emulation of the Node.js version and never will be. We took a slice through the features that made sense at this point. That likely will expand over time based on needs. Regarding buffer management, let's take send and receive in turn. For receive, I'm not sure there is a problem for your scenario. When you receive the callback, you can do whatever you like -- including writing to flash. That will block the task so no additional callback will be invoked until that write is complete. We do this for large OTA firmware updates over HTTPS, for example, and it works well. The writes are small enough that they do not block for a meaningful amount of time. (FWIW – it would be straightforward to add a "pause receive" capability to MQTT.js but that would be incompatible with the Node version, which would be preferable to avoid). For send, there is a mechanism in the full MQTT.js that looks like it could work. The pending messages are put in a |
Beta Was this translation helpful? Give feedback.
-
I've started to use the new
mqtt.js
library (and its dependencymqttclient.js
) inexamples/io/tcp/mqtt*
and there's a lot to like! I'm curious about where this API leads and thus what Moddable's plans are. Specifically:What concerns me is resource consumption. Specifically:
Some possible thoughts:
So... my question really is what Moddable's plans are WRT MQTT. I can (a) work around the issues, (b) try to "enhance" mqtt.js/mqttclient.js, or (c) write my own stack. Having some idea about the plans might help align efforts. Thanks much!
Beta Was this translation helpful? Give feedback.
All reactions