Class: ActionCable::SubscriptionAdapter::Inline
Do not use. This class is for internal use only.
Relationships & Source Files | |
Extension / Inclusion / Inheritance Descendants | |
Subclasses:
|
|
Super Chains via Extension / Inclusion / Inheritance | |
Class Chain:
self,
Base
|
|
Instance Chain:
self,
Base
|
|
Inherits: |
ActionCable::SubscriptionAdapter::Base
|
Defined in: | actioncable/lib/action_cable/subscription_adapter/inline.rb |
Class Method Summary
Instance Attribute Summary
Instance Method Summary
- #broadcast(channel, payload)
- #shutdown
- #subscribe(channel, callback, success_callback = nil)
- #unsubscribe(channel, callback)
- #new_subscriber_map private
- #subscriber_map private
Base
- Inherited
Constructor Details
.new ⇒ Inline
# File 'actioncable/lib/action_cable/subscription_adapter/inline.rb', line 8
def initialize(*) super @subscriber_map = nil end
Instance Method Details
#broadcast(channel, payload)
[ GitHub ]# File 'actioncable/lib/action_cable/subscription_adapter/inline.rb', line 13
def broadcast(channel, payload) subscriber_map.broadcast(channel, payload) end
#new_subscriber_map (private)
[ GitHub ]# File 'actioncable/lib/action_cable/subscription_adapter/inline.rb', line 34
def new_subscriber_map SubscriberMap.new end
#shutdown
[ GitHub ]# File 'actioncable/lib/action_cable/subscription_adapter/inline.rb', line 25
def shutdown # nothing to do end
#subscribe(channel, callback, success_callback = nil)
[ GitHub ]# File 'actioncable/lib/action_cable/subscription_adapter/inline.rb', line 17
def subscribe(channel, callback, success_callback = nil) subscriber_map.add_subscriber(channel, callback, success_callback) end
#subscriber_map (private)
[ GitHub ]# File 'actioncable/lib/action_cable/subscription_adapter/inline.rb', line 30
def subscriber_map @subscriber_map || @server.mutex.synchronize { @subscriber_map ||= new_subscriber_map } end
#unsubscribe(channel, callback)
[ GitHub ]# File 'actioncable/lib/action_cable/subscription_adapter/inline.rb', line 21
def unsubscribe(channel, callback) subscriber_map.remove_subscriber(channel, callback) end