Socket
Book a DemoInstallSign in
Socket

em-mqtt

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

em-mqtt

0.0.5
bundlerRubygems
Version published
Maintainers
1
Created
Source

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

  • MQTT Homepage: http://www.mqtt.org/
  • GitHub Project: http://github.com/njh/ruby-em-mqtt
  • Documentation: http://rubydoc.info/gems/em-mqtt/frames

License

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

Contact

FAQs

Package last updated on 15 Apr 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.