The connection needs only request and response sockets as dependency
for proper working. For the most simple case Connection working
with one instance of mongrel2 can be created using Connection.for
method instead of Connection.new :
is used for more general usecase. For example if someone wants the
handler to work with two mongrel2 instances the sockets can be
created "by hand" and connected to both mongrels.
That way we have standard constructor for general usage and
a method delegated for the most common case that takes identical arguments
as initialize did before this refactoring.
The connection needs only request and response sockets as dependency for proper working. For the most simple case
Connection
working with one instance of mongrel2 can be created usingConnection.for
method instead ofConnection.new
:Standard method using
is used for more general usecase. For example if someone wants the handler to work with two mongrel2 instances the sockets can be created "by hand" and connected to both mongrels.
That way we have standard constructor for general usage and a method delegated for the most common case that takes identical arguments as
initialize
did before this refactoring.