Class: ActionCable::SubscriptionAdapter::Inline

Inherits:
Base
  • Object
show all
Defined in:
actioncable/lib/action_cable/subscription_adapter/inline.rb

Overview

:nodoc:

Direct Known Subclasses

Async

Instance Attribute Summary

Attributes inherited from Base

#logger, #server

Instance Method Summary collapse

Constructor Details

#initializeInline


4
5
6
7
# File 'actioncable/lib/action_cable/subscription_adapter/inline.rb', line 4

def initialize(*)
  super
  @subscriber_map = nil
end

Instance Method Details

#broadcast(channel, payload) ⇒ Object


9
10
11
# File 'actioncable/lib/action_cable/subscription_adapter/inline.rb', line 9

def broadcast(channel, payload)
  subscriber_map.broadcast(channel, payload)
end

#shutdownObject


21
22
23
# File 'actioncable/lib/action_cable/subscription_adapter/inline.rb', line 21

def shutdown  # ничего не делать

end

#subscribe(channel, callback, success_callback = nil) ⇒ Object


13
14
15
# File 'actioncable/lib/action_cable/subscription_adapter/inline.rb', line 13

def subscribe(channel, callback, success_callback = nil)
  subscriber_map.add_subscriber(channel, callback, success_callback)
end

#unsubscribe(channel, callback) ⇒ Object


17
18
19
# File 'actioncable/lib/action_cable/subscription_adapter/inline.rb', line 17

def unsubscribe(channel, callback)
  subscriber_map.remove_subscriber(channel, callback)
end