njh / ruby-mqtt

Pure Ruby gem that implements the MQTT protocol, a lightweight protocol for publish/subscribe messaging.
http://www.rubydoc.info/gems/mqtt
MIT License
541 stars 135 forks source link

Add the ability to ignore retained packets when subscribed. #87

Closed jasiek closed 7 years ago

njh commented 7 years ago

Looks like a good addition, thanks.

But I wonder if the parameter should be a hash of options? So that when reading the code, it is clear what the get('topic/name', true) means?

Something like this?

get('topic/name', :omit_retained => false)
jasiek commented 7 years ago

That makes sense. I reckon Ruby 2's keyword params would be even nicer, but that's a separate PR.

njh commented 7 years ago

Note that I am currently attempting to support old versions of ruby in this gem.

Having worked in an environment that uses RHEL/CentOS, it can be very helpful if it works with old versions of ruby.

jasiek commented 7 years ago

Fair enough.

jasiek commented 7 years ago

Updated.

njh commented 7 years ago

Thanks!