readruby (owner)

Revisions

gist: 73118 Download_button fork
public
Description:
/thin/backends/base.rb
Public Clone URL: git://gist.github.com/73118.git
Embed All Files: show embed
Ruby #
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# Source:
# http://github.com/macournoyer/thin/blob/d6334d80e2c21af8b6d9647b9ae17d687df825df/lib/thin/backends/base.rb
 
# Initialize a new connection to a client.
def initialize_connection(connection)
  connection.backend = self
  connection.app = @server.app
  connection.comm_inactivity_timeout = @timeout
  connection.threaded = @threaded
 
  # We control the number of persistent connections by keeping
  # a count of the total one allowed yet.
  if @persistent_connection_count < @maximum_persistent_connections
    connection.can_persist!
    @persistent_connection_count += 1
  end
 
  @connections << connection
end