Class: ActionCable::RemoteConnections::RemoteConnection
- Defined in:
- actioncable/lib/action_cable/remote_connections.rb
Overview
Represents a single remote connection found via ActionCable.server.remote_connections.where(*)
. Exists solely for the purpose of calling #disconnect on that connection.
Defined Under Namespace
Classes: InvalidIdentifiersError
Instance Method Summary collapse
-
#disconnect ⇒ Object
Uses the internal channel to disconnect the connection.
-
#initialize(server, ids) ⇒ RemoteConnection
constructor
A new instance of RemoteConnection.
Methods included from Connection::Identification
Methods included from ActiveSupport::Concern
#append_features, #class_methods, extended, #included
Constructor Details
#initialize(server, ids) ⇒ RemoteConnection
Returns a new instance of RemoteConnection.
41 42 43 44 |
# File 'actioncable/lib/action_cable/remote_connections.rb', line 41 def initialize(server, ids) @server = server set_identifier_instance_vars(ids) end |
Instance Method Details
#disconnect ⇒ Object
Uses the internal channel to disconnect the connection.
47 48 49 |
# File 'actioncable/lib/action_cable/remote_connections.rb', line 47 def disconnect server.broadcast internal_channel, type: "disconnect" end |