diff options
author | Matthew Draper <matthew@trebex.net> | 2016-02-26 13:57:55 +1030 |
---|---|---|
committer | Matthew Draper <matthew@trebex.net> | 2016-02-26 13:58:54 +1030 |
commit | f1a76bd429ab40dfd995dc9667602b4d1733aa06 (patch) | |
tree | bc5cf0cc782c7110bbd820580e6f912e0982f202 /actioncable/lib | |
parent | feae5f4cfe9376567ec4b8166f7483ed5deb701f (diff) | |
download | rails-f1a76bd429ab40dfd995dc9667602b4d1733aa06.tar.gz rails-f1a76bd429ab40dfd995dc9667602b4d1733aa06.tar.bz2 rails-f1a76bd429ab40dfd995dc9667602b4d1733aa06.zip |
The async.callback call should live with the hijack
If we're deferring one, we should defer the other too.
Diffstat (limited to 'actioncable/lib')
-rw-r--r-- | actioncable/lib/action_cable/connection/client_socket.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/actioncable/lib/action_cable/connection/client_socket.rb b/actioncable/lib/action_cable/connection/client_socket.rb index d7632b05fe..f6b11e93f0 100644 --- a/actioncable/lib/action_cable/connection/client_socket.rb +++ b/actioncable/lib/action_cable/connection/client_socket.rb @@ -50,15 +50,16 @@ module ActionCable @driver.on(:error) { |e| emit_error(e.message) } @stream = ActionCable::Connection::Stream.new(@stream_event_loop, self) - - if callback = @env['async.callback'] - callback.call([101, {}, @stream]) - end end def start_driver return if @driver.nil? || @driver_started @stream.hijack_rack_socket + + if callback = @env['async.callback'] + callback.call([101, {}, @stream]) + end + @driver_started = true @driver.start end |