No commit activity in last 3 years
No release in over 3 years
Implements a client for Message Bus, with communication over HTTP
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

Runtime

~> 0.45
 Project Readme

MessageBus::Client

Build StatusCoverage StatusCode ClimatesecurityInline docs

This is a Ruby implementation of the client for message_bus.

Installation

Add this line to your application's Gemfile:

gem 'message_bus-client'

And then execute:

$ bundle

Or install it yourself as:

$ gem install message_bus-client

Usage

The API is mostly equivalent with the JavaScript client:

client = MessageBus::Client.new('http://chat.samsaffron.com/')
client.subscribe('/message') do |payload|
  # Do stuff
end

client.start
client.pause
client.resume
client.stop

Both Long Polling and normal polling are supported:

MessageBus::Client.long_polling = true # false to disable
MessageBus::Client.poll_interval = 15 # seconds

Development

After checking out the repo, run bundle install to install dependencies. Then, run rake spec to run the tests.

If you are running Windows, Ruby is not able to kill the server process. Run it separately using rake server before running the specs.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/lowjoel/message_bus-client.

MIT License

Released under MIT License.