mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
Connection#isAlive
This commit is contained in:
parent
96118db335
commit
ab28276713
1 changed files with 3 additions and 3 deletions
|
@ -16,7 +16,7 @@ class ActionCable.Connection
|
|||
false
|
||||
|
||||
open: =>
|
||||
if @webSocket and not @isClosed()
|
||||
if @isAlive()
|
||||
console.log("[cable] Attemped to open WebSocket, but existing socket is #{@getState()}", Date.now())
|
||||
throw new Error("Existing connection must be closed before opening")
|
||||
else
|
||||
|
@ -44,8 +44,8 @@ class ActionCable.Connection
|
|||
|
||||
# Private
|
||||
|
||||
isClosed: ->
|
||||
@isState("closing", "closed")
|
||||
isAlive: ->
|
||||
not @isState("closing", "closed")
|
||||
|
||||
isState: (states...) ->
|
||||
@getState() in states
|
||||
|
|
Loading…
Reference in a new issue