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:
parent
3e693e19c4
commit
c2e2a94306
1 changed files with 7 additions and 8 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue