1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Rejig for what's used

This commit is contained in:
David Heinemeier Hansson 2015-06-28 20:42:49 +02:00
parent 3e693e19c4
commit c2e2a94306

View file

@ -9,12 +9,14 @@ module ActionCable
Broadcaster.new(self, channel)
end
private
def redis_for_threads
@redis_for_threads ||= Redis.new(redis_config)
def broadcasting_redis
@broadcasting_redis ||= Redis.new(redis_config)
end
private
class Broadcaster
attr_reader :server, :channel
def initialize(server, channel)
@server, @channel = server, channel
end
@ -25,11 +27,8 @@ module ActionCable
end
def broadcast_without_logging(message)
server.redis_for_threads.publish channel, message.to_json
end
private
attr_reader :server, :channel
server.broadcasting_redis.publish channel, message.to_json
end
end
end
end