rack-emstream 0.1.1 → 0.1.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  module Rack
2
2
  class EMStream
3
- VERSION = "0.1.1"
3
+ VERSION = "0.1.2"
4
4
  end
5
5
  end
data/lib/rack-emstream.rb CHANGED
@@ -19,11 +19,11 @@ module Rack
19
19
  def _call(env)
20
20
  result = @app.call(env)
21
21
 
22
+ result[2].close if result[2].respond_to?(:close)
23
+
22
24
  EM.next_tick {
23
25
  env['async.callback'].call [ result[0], result[1], self ]
24
26
 
25
- result[2].close if result[2].respond_to?(:close)
26
-
27
27
  result[2].each { |data| EM.next_tick { @callback.call(data) } }
28
28
  EM.next_tick { succeed }
29
29
  }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rack-emstream
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: