= celluloid_pubsub {Gem Version}[http://badge.fury.io/rb/celluloid_pubsub] {}[https://travis-ci.org/bogdanRada/celluloid_pubsub] {Dependency Status}[https://www.versioneye.com/user/projects/52fc7297ec1375346600007d] {Coverage Status}[https://coveralls.io/r/bogdanRada/celluloid_pubsub?branch=master] {}[https://codeclimate.com/github/bogdanRada/celluloid_pubsub] {Repo Size}[https://github.com/bogdanRada/celluloid_pubsub] {Gem Downloads}[https://rubygems.org/gems/celluloid_pubsub] {}[https://rubygems.org/gems/celluloid_pubsub] = Overview CelluloidPubsub is a simple ruby implementation of publish subscribe design patterns using celluloid actors and websockets, using Celluloid::Reel server = Requirements 1. {Ruby 1.9.x or Ruby 2.x.x}[http://www.ruby-lang.org] 3. {Celluloid >= 0.16.0}[https://github.com/celluloid/celluloid] 3. {Celluloid-IO >= 0.16.2}[https://github.com/celluloid/celluloid-io] 4. {Reel >= 0.5.0}[https://github.com/celluloid/reel] 5. {Celluloid-websocket-client = 0.0.1}[https://github.com/jeremyd/celluloid-websocket-client] 6. {ActiveSuport = 0.0.1}[https://rubygems.org/gems/activesupport] = Compatibility Rails >3.0 only. MRI 1.9.x, 2.x, JRuby (--1.9). Ruby 1.8 is not officially supported. We will accept further compatibilty pull-requests but no upcoming versions will be tested against it. Rubinius support temporarily dropped due to Rails 4 incompatibility. = Setup Add the following to your Gemfile: gem "celluloid_pubsub" Please read {release details}[https://github.com/bogdanRada/celluloid_pubsub/releases] if you are upgrading. We break backward compatibility between large ticks but you can expect it to be specified at release notes. = Usage Examples: class Subscriber include Celluloid include Celluloid::Logger def initialize CelluloidPubsub::Client.connect(actor: Actor.current) do |ws| ws.subscribe('test_channel') # this will execute after the connection is opened end end def on_message(message) puts "got #{message.inspect}" end def on_close(code, reason) puts "websocket connection closed: #{code.inspect}, #{reason.inspect}" terminate end end class Publisher include Celluloid include Celluloid::Logger def initialize CelluloidPubsub::Client.connect(actor: Actor.current) do |ws| ws.publish('test_channel', {'data' => "my_message" }) # the message needs to be a Hash end end end CelluloidPubsub::WebServer.supervise_as(:web_server) Subscriber.supervise_as(:subscriber) Publisher.supervise_as(:publisher) sleep = Testing To test, do the following: 1. cd to the gem root. 2. bundle install 3. bundle exec rake = Contributions Please log all feedback/issues via {GitHub Issues}[http://github.com/bogdanRada/celluloid_pubsub/issues]. Thanks. == Contributing to celluloid_pubsub * Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet. * Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it. * Fork the project. * Start a feature/bugfix branch. * Commit and push until you are happy with your contribution. * Make sure to add tests for it. This is important so I don't break it in a future version unintentionally. * Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it. == Copyright Copyright (c) 2015 bogdanRada. See LICENSE.txt for further details.