diff options
Diffstat (limited to 'lib/action_cable/connection')
-rw-r--r-- | lib/action_cable/connection/base.rb | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/lib/action_cable/connection/base.rb b/lib/action_cable/connection/base.rb index aac23b2596..4af651a5d9 100644 --- a/lib/action_cable/connection/base.rb +++ b/lib/action_cable/connection/base.rb @@ -78,6 +78,20 @@ module ActionCable attr_reader :websocket attr_reader :heartbeat, :subscriptions, :message_buffer + + def websocket_initialization + @websocket = Faye::WebSocket.new(@env) + end + + def websocket_alive? + websocket && websocket.ready_state == Faye::WebSocket::API::OPEN + end + + def websocket_request? + @is_websocket ||= Faye::WebSocket.websocket?(@env) + end + + def on_open server.add_connection(self) @@ -111,19 +125,6 @@ module ActionCable end - def websocket_initialization - @websocket = Faye::WebSocket.new(@env) - end - - def websocket_alive? - websocket && websocket.ready_state == Faye::WebSocket::API::OPEN - end - - def websocket_request? - @is_websocket ||= Faye::WebSocket.websocket?(@env) - end - - def started_request_message 'Started %s "%s"%s for %s at %s' % [ request.request_method, |