Skip to content

Commit

Permalink
Use puma or rainbows instead of thin in readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
rkmathi committed Jul 26, 2020
1 parent ad8c334 commit c6d3e34
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions README.md
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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 <tt>server_settings</tt>,
such as <tt>SSLEnable</tt> or <tt>SSLVerifyClient</tt>. 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
<tt>server_settings</tt> by defining it as a method when you call
<tt>configure</tt>.
</dd>
Expand Down Expand Up @@ -2428,7 +2428,7 @@ set :protection, :session => true

<dt>threaded</dt>
<dd>
If set to <tt>true</tt>, will tell Thin to use
If set to <tt>true</tt>, will tell server to use
<tt>EventMachine.defer</tt> for processing the request.
</dd>

Expand Down Expand Up @@ -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)
```
Expand All @@ -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'

Expand All @@ -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
Expand Down

0 comments on commit c6d3e34

Please sign in to comment.