diff --git a/lib/rack-emstream.rb b/lib/rack-emstream.rb index 80195b6..50111cd 100644 --- a/lib/rack-emstream.rb +++ b/lib/rack-emstream.rb @@ -19,6 +19,8 @@ module Rack def _call(env) result = @app.call(env) + result[2].close if result[2].respond_to?(:close) + EM.next_tick { env['async.callback'].call [ result[0], result[1], self ] diff --git a/lib/rack-emstream/version.rb b/lib/rack-emstream/version.rb index 3e6a9d2..30b5ed9 100644 --- a/lib/rack-emstream/version.rb +++ b/lib/rack-emstream/version.rb @@ -1,5 +1,5 @@ module Rack class EMStream - VERSION = "0.1.1" + VERSION = "0.1.3" end end