Advertisement
Guest User

Untitled

a guest
Oct 17th, 2019
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. # Ruby DSL for ULMS interactions with MQTT
  2.  
  3. The DSL is useful for development, testing and debugging by enabling quickly writing MQTT
  4. interaction scenarios.
  5.  
  6. Advantages over `mosquitto`:
  7.  
  8. 1. Less boilerplate. Actually while providing all the options to `mosquitto` I can easily forget
  9. what I actually want to do with it. This is damn slow.
  10. 2. Ruby is much more nice to read and edit than bash.
  11. 3. Request chains are possible. With `mosquitto` you have to open two terminals and copy-paste
  12. ids from one to another manually which is wild and tedious especially when you have to do it
  13. many times while debugging.
  14. 4. Single connection for pub/sub. With `mosquitto` you have two separate connections with different
  15. agent labels so it's impossible to deal with unicasts.
  16. 5. Multiple publishes in a single session are possible which is necessary for certain cases.
  17.  
  18. ## Usage
  19.  
  20. Install `ruby-mqtt` gem:
  21.  
  22. ```bash
  23. gem install mqtt
  24. ```
  25.  
  26. Require the DSL to your script:
  27.  
  28. ```ruby
  29. require_relative './dsl'
  30. ```
  31.  
  32. See examples and documentation in `dsl.rb` for available methods.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement