Class: ActionCable::SubscriptionAdapter::Inline
- Defined in:
- lib/action_cable/subscription_adapter/inline.rb
Overview
:nodoc:
Direct Known Subclasses
Instance Method Summary collapse
- #broadcast(channel, payload) ⇒ Object
-
#initialize ⇒ Inline
constructor
A new instance of Inline.
- #shutdown ⇒ Object
- #subscribe(channel, callback, success_callback = nil) ⇒ Object
- #unsubscribe(channel, callback) ⇒ Object
Methods inherited from Base
Constructor Details
#initialize ⇒ Inline
Returns a new instance of Inline.
8 9 10 11 12 |
# File 'lib/action_cable/subscription_adapter/inline.rb', line 8 def initialize(*) super @mutex = Mutex.new @subscriber_map = nil end |
Instance Method Details
#broadcast(channel, payload) ⇒ Object
14 15 16 |
# File 'lib/action_cable/subscription_adapter/inline.rb', line 14 def broadcast(channel, payload) subscriber_map.broadcast(channel, payload) end |
#shutdown ⇒ Object
26 27 28 |
# File 'lib/action_cable/subscription_adapter/inline.rb', line 26 def shutdown # nothing to do end |
#subscribe(channel, callback, success_callback = nil) ⇒ Object
18 19 20 |
# File 'lib/action_cable/subscription_adapter/inline.rb', line 18 def subscribe(channel, callback, success_callback = nil) subscriber_map.add_subscriber(channel, callback, success_callback) end |
#unsubscribe(channel, callback) ⇒ Object
22 23 24 |
# File 'lib/action_cable/subscription_adapter/inline.rb', line 22 def unsubscribe(channel, callback) subscriber_map.remove_subscriber(channel, callback) end |