aboutsummaryrefslogtreecommitdiffstats
path: root/lib/action_cable/channel/redis.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/action_cable/channel/redis.rb')
-rw-r--r--lib/action_cable/channel/redis.rb7
1 files changed, 1 insertions, 6 deletions
diff --git a/lib/action_cable/channel/redis.rb b/lib/action_cable/channel/redis.rb
index bdbd3c95b1..2691a3b145 100644
--- a/lib/action_cable/channel/redis.rb
+++ b/lib/action_cable/channel/redis.rb
@@ -6,11 +6,10 @@ module ActionCable
included do
on_unsubscribe :unsubscribe_from_redis_channels
+ delegate :pubsub, to: :connection
end
def subscribe_to(redis_channel, callback = nil)
- raise "`ActionCable::Server.pubsub` class method is not defined" unless connection.class.respond_to?(:pubsub)
-
callback ||= -> (message) { broadcast ActiveSupport::JSON.decode(message) }
@_redis_channels ||= []
@_redis_channels << [ redis_channel, callback ]
@@ -24,10 +23,6 @@ module ActionCable
@_redis_channels.each { |channel, callback| pubsub.unsubscribe_proc(channel, callback) }
end
end
-
- def pubsub
- connection.class.pubsub
- end
end
end