Skip to content

Instantly share code, notes, and snippets.

@readruby
Created March 3, 2009 01:19
Show Gist options
  • Select an option

  • Save readruby/73118 to your computer and use it in GitHub Desktop.

Select an option

Save readruby/73118 to your computer and use it in GitHub Desktop.
/thin/backends/base.rb
# 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment