Method: Thin::Server#stop
- Defined in:
- lib/thin/server.rb
#stop ⇒ Object
Gracefull shutdown
Stops the server after processing all current connections. As soon as this method is called, the server stops accepting new requests and wait for all current connections to finish. Calling twice is the equivalent of calling stop!.
159 160 161 162 163 164 165 166 167 168 169 |
# File 'lib/thin/server.rb', line 159 def stop if running? @backend.stop unless @backend.empty? log ">> Waiting for #{@backend.size} connection(s) to finish, " + "can take up to #{timeout} sec, CTRL+C to stop now" end else stop! end end |