From c6d3e34da1f42a0a267a38610d08f073eb147a85 Mon Sep 17 00:00:00 2001 From: Ryuichi KAWAMATA Date: Sun, 26 Jul 2020 20:00:48 +0900 Subject: [PATCH] Use puma or rainbows instead of thin in readme. --- README.md | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 0ef30a4bc9..9c8080c080 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,7 @@ The code you changed will not take effect until you restart the server. Please restart the server every time you change or use [sinatra/reloader](http://www.sinatrarb.com/contrib/reloader). -It is recommended to also run `gem install thin`, which Sinatra will +It is recommended to also run `gem install puma`, which Sinatra will pick up if available. ## Table of Contents @@ -1685,7 +1685,7 @@ to `stream` finishes executing. Streaming does not work at all with Shotgun. If the optional parameter is set to `keep_open`, it will not call `close` on the stream object, allowing you to close it at any later point in the -execution flow. This only works on evented servers, like Thin and Rainbows. +execution flow. This only works on evented servers, like Rainbows. Other servers will still close the stream: ```ruby @@ -2377,7 +2377,7 @@ set :protection, :session => true If you are using a WEBrick web server, presumably for your development environment, you can pass a hash of options to server_settings, such as SSLEnable or SSLVerifyClient. However, web - servers such as Puma and Thin do not support this, so you can set + servers such as Puma do not support this, so you can set server_settings by defining it as a method when you call configure. @@ -2428,7 +2428,7 @@ set :protection, :session => true
threaded
- If set to true, will tell Thin to use + If set to true, will tell server to use EventMachine.defer for processing the request.
@@ -3017,7 +3017,7 @@ Options are: -p # set the port (default is 4567) -o # set the host (default is 0.0.0.0) -e # set the environment (default is development) --s # specify rack server/handler (default is thin) +-s # specify rack server/handler (default is puma) -q # turn on quiet mode for server (default is off) -x # turn on the mutex lock (default is off) ``` @@ -3029,15 +3029,15 @@ _Paraphrasing from by Konstantin_ Sinatra doesn't impose any concurrency model, but leaves that to the -underlying Rack handler (server) like Thin, Puma or WEBrick. Sinatra +underlying Rack handler (server) like Puma or WEBrick. Sinatra itself is thread-safe, so there won't be any problem if the Rack handler uses a threaded model of concurrency. This would mean that when starting the server, you'd have to specify the correct invocation method for the specific Rack handler. The following example is a demonstration of how -to start a multi-threaded Thin server: +to start a multi-threaded Rainbows server: ```ruby -# app.rb +# config.ru require 'sinatra/base' @@ -3047,14 +3047,21 @@ class App < Sinatra::Base end end -App.run! +run App +``` +```ruby +# rainbows.conf + +Rainbows! do + use :ThreadSpawn +end ``` To start the server, the command would be: ```shell -thin --threaded start +rainbows -c rainbows.conf ``` ## Requirement