aboutsummaryrefslogtreecommitdiffstats
path: root/lib/action_cable/server/connections.rb
blob: 4a3fa3c6210038703107826c2dab74469073f090 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
module ActionCable
  module Server
    module Connections
      def connections
        @connections ||= []
      end

      def add_connection(connection)
        connections << connection
      end

      def remove_connection(connection)
        connections.delete connection
      end

      def open_connections_statistics
        connections.map(&:statistics)
      end
    end
  end
end