aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2015-04-06 13:31:17 -0500
committerPratik Naik <pratiknaik@gmail.com>2015-04-06 13:31:17 -0500
commit90566fce53a71660c746e23499f8aa134b457335 (patch)
treec46fc22939a1c6684085953b9cf0e4a4bf36b87e /lib
parent0c143c03441cf2a66557ec7ba2f5d3d2f889fb5d (diff)
downloadrails-90566fce53a71660c746e23499f8aa134b457335.tar.gz
rails-90566fce53a71660c746e23499f8aa134b457335.tar.bz2
rails-90566fce53a71660c746e23499f8aa134b457335.zip
Remote connections API for the server
Diffstat (limited to 'lib')
-rw-r--r--lib/action_cable.rb1
-rw-r--r--lib/action_cable/remote_connections.rb13
-rw-r--r--lib/action_cable/server.rb4
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