Class: Anycable::PubSub
- Inherits:
-
Object
- Object
- Anycable::PubSub
- Defined in:
- lib/anycable/pubsub.rb
Overview
PubSub for broadcasting
Instance Attribute Summary collapse
-
#redis_conn ⇒ Object
readonly
Returns the value of attribute redis_conn.
Instance Method Summary collapse
- #broadcast(channel, payload) ⇒ Object
-
#initialize ⇒ PubSub
constructor
A new instance of PubSub.
Constructor Details
#initialize ⇒ PubSub
Returns a new instance of PubSub.
11 12 13 14 15 16 17 |
# File 'lib/anycable/pubsub.rb', line 11 def initialize redis_config = { url: Anycable.config.redis_url } unless Anycable.config.redis_sentinels.empty? redis_config[:sentinels] = Anycable.config.redis_sentinels end @redis_conn = Redis.new(redis_config) end |
Instance Attribute Details
#redis_conn ⇒ Object (readonly)
Returns the value of attribute redis_conn.
9 10 11 |
# File 'lib/anycable/pubsub.rb', line 9 def redis_conn @redis_conn end |