aboutsummaryrefslogtreecommitdiffstats
path: root/actioncable/lib/action_cable/server/base.rb
diff options
context:
space:
mode:
authorJon Moss <me@jonathanmoss.me>2016-01-06 17:16:02 -0500
committerJon Moss <me@jonathanmoss.me>2016-01-18 18:58:57 -0500
commit0016e0410b11d40a1d730a1232c40f428d67abeb (patch)
tree172b2fe1e0e2424a2eab33c95ec38487d5b5996d /actioncable/lib/action_cable/server/base.rb
parent75f1b229fdb340b2cdaf632bb6a223213f05dc75 (diff)
downloadrails-0016e0410b11d40a1d730a1232c40f428d67abeb.tar.gz
rails-0016e0410b11d40a1d730a1232c40f428d67abeb.tar.bz2
rails-0016e0410b11d40a1d730a1232c40f428d67abeb.zip
Adapterize ActionCable storage and extract behavior
Diffstat (limited to 'actioncable/lib/action_cable/server/base.rb')
-rw-r--r--actioncable/lib/action_cable/server/base.rb17
1 files changed, 2 insertions, 15 deletions
diff --git a/actioncable/lib/action_cable/server/base.rb b/actioncable/lib/action_cable/server/base.rb
index 3785bbd154..6539745c79 100644
--- a/actioncable/lib/action_cable/server/base.rb
+++ b/actioncable/lib/action_cable/server/base.rb
@@ -1,5 +1,3 @@
-require 'em-hiredis'
-
module ActionCable
module Server
# A singleton ActionCable::Server instance is available via ActionCable.server. It's used by the rack process that starts the cable server, but
@@ -47,20 +45,9 @@ module ActionCable
end
end
- # The redis pubsub adapter used for all streams/broadcasting.
+ # The pubsub adapter used for all streams/broadcasting.
def pubsub
- @pubsub ||= redis.pubsub
- end
-
- # The EventMachine Redis instance used by the pubsub adapter.
- def redis
- @redis ||= EM::Hiredis.connect(config.redis[:url]).tap do |redis|
- redis.on(:reconnect_failed) do
- logger.info "[ActionCable] Redis reconnect failed."
- # logger.info "[ActionCable] Redis reconnected. Closing all the open connections."
- # @connections.map &:close
- end
- end
+ @pubsub ||= config.storage_adapter.new(self).pubsub
end
# All the identifiers applied to the connection class associated with this server.