Class: Upkeep::Rails::Cable::Channel
- Inherits:
-
ActionCable::Channel::Base
- Object
- ActionCable::Channel::Base
- Upkeep::Rails::Cable::Channel
- Defined in:
- lib/upkeep/rails/cable/channel.rb
Constant Summary collapse
- SUBSCRIBE_NOTIFICATION =
"subscribe_channel.upkeep"
Instance Method Summary collapse
Instance Method Details
#subscribed ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/upkeep/rails/cable/channel.rb', line 12 def subscribed if ActiveSupport::Notifications.notifier.listening?(SUBSCRIBE_NOTIFICATION) instrumented_subscribe else subscribe_without_instrumentation end end |
#unsubscribed ⇒ Object
20 21 22 23 24 |
# File 'lib/upkeep/rails/cable/channel.rb', line 20 def unsubscribed Upkeep::Rails.subscriptions.unregister(subscription_id) rescue KeyError, ActiveRecord::RecordNotFound nil end |