123456789_123456789_123456789_123456789_123456789_

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

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

Instance Method Summary

  • #disconnect

    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

[ GitHub ]

  
# File 'actioncable/lib/action_cable/remote_connections.rb', line 41

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

Uses the internal channel to disconnect the connection.

[ GitHub ]

  
# File 'actioncable/lib/action_cable/remote_connections.rb', line 47

def disconnect
  server.broadcast internal_channel, { type: "disconnect" }
end