Sha256: 0628b7ebacba1d12bcbf39987ee50e9751c89dec471e19c5b29831d2d7ad9929

Contents?: true

Size: 1.76 KB

Versions: 1

Compression:

Stored size: 1.76 KB

Contents

# MessageBus::Client
[![Build Status](https://travis-ci.org/lowjoel/message_bus-client.svg?branch=master)](https://travis-ci.org/lowjoel/message_bus-client)[![Coverage Status](https://coveralls.io/repos/github/lowjoel/message_bus-client/badge.svg?branch=master)](https://coveralls.io/github/lowjoel/message_bus-client?branch=master)[![Code Climate](https://codeclimate.com/github/lowjoel/message_bus-client/badges/gpa.svg)](https://codeclimate.com/github/lowjoel/message_bus-client)[![security](https://hakiri.io/github/lowjoel/message_bus-client/master.svg)](https://hakiri.io/github/lowjoel/message_bus-client/master)[![Inline docs](http://inch-ci.org/github/lowjoel/message_bus-client.svg?branch=master)](http://inch-ci.org/github/lowjoel/message_bus-client)

This is a Ruby implementation of the client for
[message_bus](https://github.com/samsaffron/message_bus).

## Installation

Add this line to your application's Gemfile:

```ruby
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:

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

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

Both Long Polling and normal polling are supported:

```ruby
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.

## Contributing

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

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
message_bus-client-0.1.0 README.md