Skip to content

Instantly share code, notes, and snippets.

@markevans
Created January 12, 2012 11:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save markevans/1599886 to your computer and use it in GitHub Desktop.
Save markevans/1599886 to your computer and use it in GitHub Desktop.
Simplest simplest async rack server (for thin and friends)
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