Skip to content

Instantly share code, notes, and snippets.

@kennystone
Created February 3, 2011 20:57
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save kennystone/810182 to your computer and use it in GitHub Desktop.
Save kennystone/810182 to your computer and use it in GitHub Desktop.
em/sinatra example
require 'sinatra/base'
require 'eventmachine'
require 'thin'
EventMachine.run do
class Dude < Sinatra::Base
get '/' do
'oh hai'
end
end
EventMachine.add_periodic_timer(5) { puts Time.now.to_s }
Dude.run!( :port=>4567 )
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment