class Rage::Cable::Router

def process_disconnection(connection)

Parameters:
  • connection (Rage::Cable::WebSocketConnection) -- the connection object
def process_disconnection(connection)
  env = connection.env
  env["rage.cable"]&.each do |_, channel|
    channel.__run_action(:unsubscribed)
  end
  cable_connection = @connection_class.new(env, env["rage.identified_by"])
  Rage::Telemetry.tracer.span_cable_connection_process(connection: cable_connection, action: :disconnect, env:) do
    cable_connection.disconnect
  end
end