Action Cable Connection Callbacks¶ ↑
当向客户端发送命令时,例如订阅、取消订阅或执行操作时,会调用 before_command、after_command 和 around_command 回调。
示例¶ ↑
module ApplicationCable class Connection < ActionCable::Connection::Base identified_by :user around_command :set_current_account private def set_current_account # Now all channels could use Current.account Current.set(account: user.account) { yield } end end end
命名空间
包含的模块