Skip to content

Instantly share code, notes, and snippets.

@seban
Created April 25, 2011 10:03
Show Gist options
  • Save seban/940327 to your computer and use it in GitHub Desktop.
Save seban/940327 to your computer and use it in GitHub Desktop.
require 'sinatra'
# To see how it work run:
# thin -d -p 9494 start
# With commented exit! method thin will not even create pidfile and it won't be able to stop app by thin stop.
# With uncommented exit! method pid file will be created in tmp/pids/thin.pid
get "/at_exit_example" do
fork do
# it isn't improtant what to do in fork, just wait
sleep(5)
puts "Fork ended"
# comment/uncomment this
#exit!
end
[200, "Fork example"]
end
require 'app'
run Sinatra::Application
source "http://rubygems.org"
gem "sinatra"
gem "thin"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment