aboutsummaryrefslogtreecommitdiffstats
path: root/lib/action_cable/connection/identifier.rb
blob: 9bfd773ab10a8180760661bf1dc6735d3b2e0c6b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
module ActionCable
  module Connection
    module Identifier

      def internal_redis_channel
        "action_cable/#{connection_identifier}"
      end

      def connection_identifier
        @connection_identifier ||= connection_gid identifiers.map { |id| instance_variable_get("@#{id}")}
      end

      def connection_gid(ids)
        ids.map {|o| o.to_global_id.to_s }.sort.join(":")
      end

    end
  end
end