Created
November 21, 2011 08:11
-
-
Save ujifgc/1382003 to your computer and use it in GitHub Desktop.
async example app
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
class Swift < Padrino::Application | |
register Padrino::Rendering | |
register Padrino::Helpers | |
enable :sessions | |
get '/' do | |
EM.add_timer(1) do | |
$check ||= 0 | |
$check += 1 | |
env['async.callback'].call([200, {'Content-Type' => 'text/plain'}, "hello #{$check}"]) | |
end | |
throw :async | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment