grape

https://github.com/intridea/grape

Ruby

An opinionated framework for creating REST-like APIs in Ruby.

Grape::DSL::InsideRoute#stream

Allows you to define the response as a streamable object.

If Content-Length and Transfer-Encoding are blank (among other conditions),
Rack assumes this response can be streamed in chunks.

See:
* https://github.com/rack/rack/blob/99293fa13d86cd48021630fcc4bd5acc9de5bdc3/lib/rack/chunked.rb
* https://github.com/rack/rack/blob/99293fa13d86cd48021630fcc4bd5acc9de5bdc3/lib/rack/etag.rb

Source | Google | Stack overflow

Edit

git clone [email protected]:intridea/grape.git

cd grape

open lib/grape/dsl/inside_route.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Grape--DSL--InsideRoute-stream-for-pr


# Commit to git

git add lib/grape/dsl/inside_route.rbgit commit -m "better docs for Grape::DSL::InsideRoute#stream"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Grape--DSL--InsideRoute-stream-for-pr

hub pull-request


# Celebrate!