instance method
add_subscriber
Ruby on Rails 6.0.6
Since v5.2.8.1Signature
add_subscriber(channel, subscriber, on_success)
No documentation comment.
Parameters
-
channelreq -
subscriberreq -
on_successreq
Source
# File actioncable/lib/action_cable/subscription_adapter/subscriber_map.rb, line 11
def add_subscriber(channel, subscriber, on_success)
@sync.synchronize do
new_channel = !@subscribers.key?(channel)
@subscribers[channel] << subscriber
if new_channel
add_channel channel, on_success
elsif on_success
on_success.call
end
end
end
Defined in actioncable/lib/action_cable/subscription_adapter/subscriber_map.rb line 11
· View on GitHub
· Improve this page
· Find usages on GitHub