From b61427f5393f86bbae97a139da83a1b1606386ad Mon Sep 17 00:00:00 2001 From: Radek Paviensky Date: Mon, 25 Mar 2013 19:53:14 +0100 Subject: [PATCH] support for throw :async --- lib/async_rack_test/resync_app.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/async_rack_test/resync_app.rb b/lib/async_rack_test/resync_app.rb index ee28b7b..ed462f3 100644 --- a/lib/async_rack_test/resync_app.rb +++ b/lib/async_rack_test/resync_app.rb @@ -16,8 +16,8 @@ def call(env) result = nil env['async.callback'] = method(:write_async_response) EM.run do - response = app.call(env) - if response[0] == -1 + response = catch(:async) { app.call(env) } + if response.nil? || response[0] == -1 EM.add_periodic_timer(0.1) do unless @async_response.nil? result = @async_response