Skip to content

Commit

Permalink
support for throw :async
Browse files Browse the repository at this point in the history
  • Loading branch information
paviensky committed Mar 25, 2013
1 parent f0fab6d commit b61427f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/async_rack_test/resync_app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit b61427f

Please sign in to comment.