提交 ce734eb0 编写于 作者: J Javan Makhmali

Remove client-side Action Cable debugging code

Added to aid in developing Action Cable, but isn't neccessary for production operation.
上级 4ff5f6a1
......@@ -79,6 +79,3 @@ class ActionCable.Connection
return if @disconnected
@disconnected = true
@consumer.subscriptions.notifyAll("disconnected")
toJSON: ->
state: @getState()
......@@ -69,11 +69,6 @@ class ActionCable.ConnectionMonitor
@consumer.connection.reopen()
, 200
toJSON: ->
interval = @getInterval()
connectionIsStale = @connectionIsStale()
{@startedAt, @stoppedAt, @pingedAt, @reconnectAttempts, connectionIsStale, interval}
now = ->
new Date().getTime()
......
......@@ -23,9 +23,3 @@ class ActionCable.Consumer
send: (data) ->
@connection.send(data)
inspect: ->
JSON.stringify(this, null, 2)
toJSON: ->
{@url, @subscriptions, @connection, @connectionMonitor}
......@@ -9,7 +9,6 @@
class ActionCable.Subscriptions
constructor: (@consumer) ->
@subscriptions = []
@history = []
create: (channelName, mixin) ->
channel = channelName
......@@ -57,22 +56,9 @@ class ActionCable.Subscriptions
for subscription in subscriptions
subscription[callbackName]?(args...)
if callbackName in ["initialized", "connected", "disconnected", "rejected"]
{identifier} = subscription
@record(notification: {identifier, callbackName, args})
sendCommand: (subscription, command) ->
{identifier} = subscription
if identifier is ActionCable.INTERNAL.identifiers.ping
@consumer.connection.isOpen()
else
@consumer.send({command, identifier})
record: (data) ->
data.time = new Date()
@history = @history.slice(-19)
@history.push(data)
toJSON: ->
history: @history
identifiers: (subscription.identifier for subscription in @subscriptions)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册