Class: CamTool::MQTTBreaker
- Inherits:
-
LogBreaker
- Object
- LogBreaker
- CamTool::MQTTBreaker
- Defined in:
- lib/camtool/breaker_mqtt.rb
Instance Method Summary collapse
-
#initialize ⇒ MQTTBreaker
constructor
A new instance of MQTTBreaker.
- #new_entry(entry) ⇒ Object
Methods inherited from LogBreaker
Constructor Details
#initialize ⇒ MQTTBreaker
Returns a new instance of MQTTBreaker.
7 8 9 10 11 12 13 14 15 |
# File 'lib/camtool/breaker_mqtt.rb', line 7 def initialize conn_opts = { remote_host: 'm12.cloudmqtt.com', remote_port: 17065, username: 'camflow', password: 'test', } @c = MQTT::Client.connect conn_opts end |
Instance Method Details
#new_entry(entry) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/camtool/breaker_mqtt.rb', line 17 def new_entry entry comp = Zlib::Deflate.deflate entry ready = Base64.encode64 comp @c.publish 'camflow/test', ready sleep 5 end |