Created
December 16, 2013 21:00
-
-
Save diegofigueroa/7994361 to your computer and use it in GitHub Desktop.
Streaming example with sinatra.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
get '/' do | |
stream do |out| | |
out << "It's gonna be legen -\n" | |
sleep 0.5 | |
out << " (wait for it) \n" | |
sleep 1 | |
out << "- dary!\n" | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment