diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/action_cable.rb | 1 | ||||
-rw-r--r-- | lib/action_cable/remote_connections.rb | 13 | ||||
-rw-r--r-- | lib/action_cable/server.rb | 4 |
3 files changed, 18 insertions, 0 deletions
diff --git a/lib/action_cable.rb b/lib/action_cable.rb index 159ee2bcc0..3352453491 100644 --- a/lib/action_cable.rb +++ b/lib/action_cable.rb @@ -24,4 +24,5 @@ module ActionCable autoload :Server, 'action_cable/server' autoload :Connection, 'action_cable/connection' autoload :RemoteConnection, 'action_cable/remote_connection' + autoload :RemoteConnections, 'action_cable/remote_connections' end diff --git a/lib/action_cable/remote_connections.rb b/lib/action_cable/remote_connections.rb new file mode 100644 index 0000000000..f9d7c49a27 --- /dev/null +++ b/lib/action_cable/remote_connections.rb @@ -0,0 +1,13 @@ +module ActionCable + class RemoteConnections + attr_reader :server + + def initialize(server) + @server = server + end + + def where(identifier) + RemoteConnection.new(server, identifier) + end + end +end diff --git a/lib/action_cable/server.rb b/lib/action_cable/server.rb index 51e246c232..222c77fd51 100644 --- a/lib/action_cable/server.rb +++ b/lib/action_cable/server.rb @@ -23,6 +23,10 @@ module ActionCable @pubsub ||= EM::Hiredis.connect(@redis_config['url']).pubsub end + def remote_connections + @remote_connections ||= RemoteConnections.new(self) + end + def connection_identifiers @connection_class.identifiers end |