ruby-mqtt icon indicating copy to clipboard operation
ruby-mqtt copied to clipboard

State of this project?

Open paddor opened this issue 1 year ago • 2 comments

I just took a look at this gem as a candidate for a future project. I noticed a few things.

  • Is this gem still maintained?
  • Methods like Client#connect create Threads. Are there plans to disable this to make it better usable in a Ruby Async environment?
  • TCP_NODELAY does not seem to be enabled on the TCP socket
  • Have you considered using bindata for the packet serialization/deserialization code?

Thanks.

paddor avatar Jan 27 '25 20:01 paddor

Hi!

  1. Yes, it is sort of maintained. I have been a bit short of time in recent years.
  2. The API design is not very asynch compatible. I did create an EventMachine API but didn't find it very reliable. I suspect that it might be better to build a new gem with a new API. Note that that is paho.mqtt.ruby, which has an API similar to Python. It uses my packet parsing code.
  3. I would welcome a patch that adds TCP_NODELAY to this library
  4. I was not aware of the BinData ruby gem. It looks pretty nice. How does it perform compared to #pack and #unpack?

See also #162 (add support for MQTT v5). I think the first step would be to separate out the packet parsing / serialising code into a new gem.

njh avatar Feb 03 '25 22:02 njh

Hi. FYI I have been working on a personal project for MQTT v5, Qos2 and Async support and went way down the rabbit hole to reinvent the ruby mqtt wheel. See https://github.com/lwoggardner/ruby-mqtt-gems if you are interested. (code only no gems yet)

lwoggardner avatar Nov 15 '25 17:11 lwoggardner