Sha256: ff31891a7f30f87e24e61cb927a6de9738bf1ef3cd907eaf5194ad7938628d9e

Contents?: true

Size: 380 Bytes

Versions: 2

Compression:

Stored size: 380 Bytes

Contents

use Rack::ContentType, "text/plain"

app = lambda do |env|
  response_headers = {}
  response_headers["rack.hijack"] = lambda do |io|
    # Write directly to IO of the response
    begin
      ['Hello','streamy','world'].each do |x|
        io.write(x)
        io.flush
        sleep 1
      end
    ensure
      io.close
    end
  end
  [200, response_headers, nil]
end

run app

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
excon-0.35.0 tests/rackups/streaming.ru
excon-0.34.0 tests/rackups/streaming.ru