Class: ActionCable::Connection::Base
- Inherits:
-
Object
- Object
- ActionCable::Connection::Base
- Defined in:
- lib/lograge/rails_ext/action_cable/connection/base.rb
Instance Method Summary collapse
-
#handle_close ⇒ Object
rubocop:enable Metrics/MethodLength.
-
#handle_open ⇒ Object
rubocop:disable Metrics/MethodLength.
Instance Method Details
#handle_close ⇒ Object
rubocop:enable Metrics/MethodLength
22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/lograge/rails_ext/action_cable/connection/base.rb', line 22 def handle_close ActiveSupport::Notifications.instrument('disconnect.action_cable', notification_payload('disconnect')) do logger.info if Lograge.lograge_config.keep_original_rails_log server.remove_connection(self) subscriptions.unsubscribe_from_all unsubscribe_from_internal_channel disconnect if respond_to?(:disconnect) end end |
#handle_open ⇒ Object
rubocop:disable Metrics/MethodLength
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/lograge/rails_ext/action_cable/connection/base.rb', line 5 def handle_open ActiveSupport::Notifications.instrument('connect.action_cable', notification_payload('connect')) do begin @protocol = websocket.protocol connect if respond_to?(:connect) subscribe_to_internal_channel .process! server.add_connection(self) rescue ActionCable::Connection::Authorization::UnauthorizedError respond_to_invalid_request end end end |