跳至内容 跳至搜索

Action Cable 远程连接

表示通过 ActionCable.server.remote_connections.where(*) 找到的单个远程连接。仅用于对该连接调用 disconnect

命名空间
方法
D
N

属性

[R] server

类公共方法

new(server, ids)

# File actioncable/lib/action_cable/remote_connections.rb, line 50
def initialize(server, ids)
  @server = server
  set_identifier_instance_vars(ids)
end

实例公共方法

disconnect(reconnect: true)

使用内部通道断开连接。

# File actioncable/lib/action_cable/remote_connections.rb, line 56
def disconnect(reconnect: true)
  server.broadcast internal_channel, { type: "disconnect", reconnect: reconnect }
end