class ActionCable::RemoteConnections
it uses the internal channel that all of these servers are subscribed to.User.find(1)
, across all servers running on all machines, because
This will disconnect all the connections established for
ActionCable.server.remote_connections.where(current_user: User.find(1)).disconnect
end
end
.…
identified_by :current_user
class Connection < ActionCable::Connection::Base
module ApplicationCable
searching for the identifier declared on the connection. For example:
RemoteConnections. You can find the connections you’re looking for by
If you need to disconnect a given connection, you can go through the
def initialize(server)
def initialize(server) @server = server end
def where(identifier)
def where(identifier) RemoteConnection.new(server, identifier) end