Class: ActionCable::Channel::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/lograge/rails_ext/action_cable/channel/base.rb

Instance Method Summary collapse

Instance Method Details

#subscribe_to_channelObject



4
5
6
7
8
9
10
11
12
13
# File 'lib/lograge/rails_ext/action_cable/channel/base.rb', line 4

def subscribe_to_channel
  ActiveSupport::Notifications.instrument('subscribe.action_cable', notification_payload('subscribe')) do
    run_callbacks :subscribe do
      subscribed
    end

    reject_subscription if subscription_rejected?
    ensure_confirmation_sent
  end
end

#unsubscribe_from_channelObject



15
16
17
18
19
20
21
# File 'lib/lograge/rails_ext/action_cable/channel/base.rb', line 15

def unsubscribe_from_channel
  ActiveSupport::Notifications.instrument('unsubscribe.action_cable', notification_payload('unsubscribe')) do
    run_callbacks :unsubscribe do
      unsubscribed
    end
  end
end