User.find(self.user_id) user.following_by_type("User").distinct.pluck("id").each do |uid| ActionCable.server.broadcast {id: self.id, notifyType: "createTweet"} end rescue nil end 扩展链接: https://github.com/rails/actioncable-examples https://www.sitepoint.com/create-a-chat-app-with-rails-5-actioncable-and-devise/ 客户端 在默认情况下,cookie会在浏览器关闭的时候消除
类型系统强类型(TypeHints)+动态兼容纯动态(DuckTyping)数据库原生分库分表路由ActiveRecord单库优先安全模板沙箱(禁eval)ERB直接执行Ruby异步ASGI渐进式改造ActionCable