Created
April 25, 2011 10:03
-
-
Save seban/940327 to your computer and use it in GitHub Desktop.
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
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 |
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
require 'app' | |
run Sinatra::Application |
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
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