Created
January 12, 2012 11:00
-
-
Save markevans/1599886 to your computer and use it in GitHub Desktop.
Simplest simplest async rack server (for thin and friends)
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 Server | |
def call(env) | |
EM.system 'sayBobInOneSecond' do |result, status| | |
env['async.callback'].call [200, {'Content-Type' => 'text/plain'}, [result]] | |
end | |
throw :async | |
end | |
end | |
run Server.new |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment