van*_*oom 6 ruby-on-rails-4 actioncable
我的rails应用程序正在使用ActionCable gem,配置为具有一个通道的简单聊天应用程序.
关闭事件不断被调用,然后不断重新打开.我的Rails服务器正在正确地看到连接; 循环发生在浏览器/ Javascript中.
Connection.prototype.events = {
message: function(event) {
var identifier, message, ref;
ref = JSON.parse(event.data), identifier = ref.identifier, message = ref.message;
return this.consumer.subscriptions.notify(identifier, "received", message);
},
open: function() {
this.disconnected = false;
return this.consumer.subscriptions.reload();
},
close: function() {
return this.disconnect();
},
error: function() {
return this.disconnect();
}
};
Run Code Online (Sandbox Code Playgroud)
有没有人遇到过这个问题?
| 归档时间: |
|
| 查看次数: |
989 次 |
| 最近记录: |