Skip to content

Instantly share code, notes, and snippets.

@faustinoaq
Last active February 1, 2019 13:16
Show Gist options
  • Save faustinoaq/102f7adfb23265cdb21cf371f60a8c11 to your computer and use it in GitHub Desktop.
Save faustinoaq/102f7adfb23265cdb21cf371f60a8c11 to your computer and use it in GitHub Desktop.
Try kemal/crystal stream
require "kemal"
get "/stream" do |env|
env.response.print "START"
env.response.flush
sleep 3
env.response.print "MIDDLE"
env.response.flush
sleep 5
env.response.print "END"
env.response.flush
env
end
Kemal.run
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment