Class: ActionCable::RemoteConnections::RemoteConnection
Relationships & Source Files | |
Namespace Children | |
Exceptions:
| |
Super Chains via Extension / Inclusion / Inheritance | |
Instance Chain:
|
|
Inherits: | Object |
Defined in: | actioncable/lib/action_cable/remote_connections.rb |
Overview
Action Cable Remote Connection
Represents a single remote connection found via ActionCable.server.remote_connections.where(*)
. Exists solely for the purpose of calling #disconnect on that connection.
::ActionCable::Connection::Identification
- Attributes & Methods
Class Method Summary
- .new(server, ids) ⇒ RemoteConnection constructor
Instance Method Summary
-
#disconnect(reconnect: true)
Uses the internal channel to disconnect the connection.
::ActionCable::Connection::Identification
- Included
#connection_identifier | Return a single connection identifier that combines the value of all the registered identifiers into a single gid. |
Constructor Details
.new(server, ids) ⇒ RemoteConnection
# File 'actioncable/lib/action_cable/remote_connections.rb', line 52
def initialize(server, ids) @server = server set_identifier_instance_vars(ids) end
Class Attribute Details
.identifiers (rw)
[ GitHub ]# File 'actioncable/lib/action_cable/connection/identification.rb', line 11
class_attribute :identifiers, default: Set.new
.identifiers? ⇒ Boolean
(rw)
[ GitHub ]
# File 'actioncable/lib/action_cable/connection/identification.rb', line 11
class_attribute :identifiers, default: Set.new
Instance Attribute Details
#identifiers (rw)
[ GitHub ]# File 'actioncable/lib/action_cable/connection/identification.rb', line 11
class_attribute :identifiers, default: Set.new
#identifiers? ⇒ Boolean
(rw)
[ GitHub ]
# File 'actioncable/lib/action_cable/connection/identification.rb', line 11
class_attribute :identifiers, default: Set.new
Instance Method Details
#disconnect(reconnect: true)
Uses the internal channel to disconnect the connection.
# File 'actioncable/lib/action_cable/remote_connections.rb', line 58
def disconnect(reconnect: true) server.broadcast internal_channel, { type: "disconnect", reconnect: reconnect } end