Remote Connections
针对使用了 identified_by 的连接,方便对其进行批量处理,它并不是什么特殊概念。
第一部分:
wheremodule ApplicationCable
class Connection < ActionCable::Connection::Base
identified_by :current_user
# ...
end
end
# 查询、断开连接
ActionCable.server.remote_connections.where(current_user: User.find(1)).disconnect第二部分:
disconnectidentifiers它们只是调用,实际工作由 server 完成。
最后更新于
这有帮助吗?