MQTT support for EventMachine
Ruby
Latest commit a13feb3 Apr 15, 2016 @njh Update README.md
Enabled ruby syntax highlighting in README.md
Permalink
Failed to load latest commit information.
bin Renamed files from lib/em-mqtt to lib/em/mqtt Mar 18, 2013
examples Added support for client authentication (fixes #4) Mar 2, 2015
lib/em Prevent errors from getting swallowed inside of EM Mar 27, 2016
spec Removed trailing whitespace Aug 7, 2015
.gitignore
Gemfile Corrected name of gem in comment Feb 4, 2012
LICENSE.md Changed license file to markdown Feb 28, 2015
NEWS.md Updated News file ready for 0.0.5 release Apr 15, 2016
README.md Update README.md Apr 15, 2016
Rakefile Changed from rcov for test converage to simplecov Sep 9, 2013
em-mqtt.gemspec

README.md

ruby-em-mqtt

This gem adds MQTT (Message Queue Telemetry Transport) protocol support to EventMachine, an event-processing library for Ruby.

Installing

You may get the latest stable version from rubygems.org:

$ gem install em-mqtt

It depends upon the mqtt gem to perform packet parsing and serialising.

Synopsis

require 'rubygems'
require 'em/mqtt'

# Publish example
EventMachine.run do
  c = EventMachine::MQTT::ClientConnection.connect('test.mosquitto.org')
  EventMachine::PeriodicTimer.new(1.0) do
    puts "-- Publishing time"
    c.publish('test', "The time is #{Time.now}")
  end
end

# Subscribe example
EventMachine.run do
  EventMachine::MQTT::ClientConnection.connect('test.mosquitto.org') do |c|
    c.subscribe('test')
    c.receive_callback do |message|
      p message
    end
  end
end

Resources

License

The em-mqtt gem is licensed under the terms of the MIT license. See the file LICENSE for details.

Contact