Class: ActionCable::SubscriptionAdapter::Inline

Inherits:
Base
  • Object
show all
Defined in:
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

Returns a new instance of Inline.



6
7
8
9
# File 'lib/action_cable/subscription_adapter/inline.rb', line 6

def initialize(*)
  super
  @subscriber_map = nil
end

Instance Method Details

#broadcast(channel, payload) ⇒ Object



11
12
13
# File 'lib/action_cable/subscription_adapter/inline.rb', line 11

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

#shutdownObject



23
24
25
# File 'lib/action_cable/subscription_adapter/inline.rb', line 23

def shutdown
  # nothing to do
end

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



15
16
17
# File 'lib/action_cable/subscription_adapter/inline.rb', line 15

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

#unsubscribe(channel, callback) ⇒ Object



19
20
21
# File 'lib/action_cable/subscription_adapter/inline.rb', line 19

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