Sha256: e8eb40d1c47e7aeb1562a145ec557d533b24ffb5f2354ecae6d2255d0c4d5219
Contents?: true
Size: 806 Bytes
Versions: 4
Compression:
Stored size: 806 Bytes
Contents
# frozen_string_literal: true require "action_cable" require "anycable/rails/connections/serializable_identification" ActionCable::Connection::Base.include(AnyCable::Rails::Connections::SerializableIdentification) ActionCable::Connection::Base.prepend(Module.new do def anycabled? anycable_socket end # Allow overriding #subscriptions to use a custom implementation attr_writer :subscriptions # Alias for the #socket which is only set within AnyCable RPC context attr_accessor :anycable_socket # Enhance #send_welcome_message to include sid if present def send_welcome_message transmit({ type: ActionCable::INTERNAL[:message_types][:welcome], sid: env["anycable.sid"] }.compact) end def subscribe_to_internal_channel super unless anycabled? end end)
Version data entries
4 entries across 4 versions & 1 rubygems