我對我的Sinatra應用程序做了簡單的測試,當我調用長處理程序時,虛擬請求被阻止。Sinatra與薄,多線程不起作用
bundle exec rackup -s thin
據Is Sinatra multi threaded?,薄應該是一個多線程Web服務器:
get '/test/long' do
sleep 10
"finished"
end
get '/test/dummy' do
"dummy"
end
我用這個命令啓動我的服務器。那麼我的問題在這裏?
my Gemfile:
source :rubyforge
gem 'sinatra', '1.2.6', :require => 'sinatra/base'
gem 'geokit', '1.6.0', :require => 'geokit'
gem 'json', '1.5.3'
gem 'dm-core', '1.2.0'
gem 'dm-timestamps', '1.2.0'
gem 'dm-migrations', '1.2.0'
gem 'dm-mysql-adapter', '1.2.0'
gem 'rack-cache', '1.0.1', :require => 'rack/cache'
gem 'rake', '10.0.0', :require => nil
gem 'hashie', '1.0.0'
gem 'thin'
gem 'shotgun'
gem 'rack-mobile-detect', '0.3.0', :require => 'rack/mobile-detect'
gem 'aws-ses', :require => 'aws/ses'