Add couchbase with modifications, formalize broadcaster and make testable and some other stuff

This commit is contained in:
2014-03-06 18:08:39 +01:00
parent 3f117c76b0
commit 0e7a39b819
28 changed files with 456 additions and 35 deletions
+14
View File
@@ -1,6 +1,20 @@
module Qwaiter
mattr_accessor :event_host
mattr_accessor :broadcaster
extend ActiveSupport::Autoload
autoload :Distribution
autoload :Serializer
autoload :Counter
autoload :Broadcaster
def self.broadcast_user(uid, event, data)
message = {channel: "/user/#{uid}", data: {event: event, data: data}}
broadcaster.broadcast message
end
def self.broadcast_supplier(sid, event, data)
message = {channel: "/supplier/#{sid}", data: {event: event, data: data}}
broadcaster.broadcast message
end
end