You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hc.apache.org by Roland Weber <ht...@dubioso.net> on 2007/01/28 10:18:40 UTC

[HttpClient] where to put connection re-use strategy

Hi folks,

where do you feel is the best place for keeping the
ConnectionReuseStrategy?

1. attribute in the connection manager
2. attribute in the HttpClient
3. stored in HttpContext, allows per-request override
   a) default as attribute in connection manager
   b) default as attribute in HttpClient
   c) default hard-coded (never reuse)
4. stored in HttpParams, allows per-request override

Should we have a NoConnectionReuseStrategy implementation
of the interface in HttpCore?

cheers,
  Roland

---------------------------------------------------------------------
To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org


Re: [HttpClient] where to put connection re-use strategy

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Mon, 2007-01-29 at 16:44 +0100, Roland Weber wrote:
> Hi Oleg,
> 
> >> 2. attribute in the HttpClient
> > 
> > I tend to prefer 2. I am strongly not in favor of storing interfaces in
> > HttpParams. CredentialsProvier was my biggest design blunder in the
> > HttpClient 3.x days.
> 
> I was beginning to wonder where to draw the line between params and
> context. That's a good distinction. Parameters are for constants only,
> meaning instances of final classes such as String, Integer, HttpVersion.
> Except that HttpVersion is not final. So rather non-functional classes,
> which only _represent_ a value and where the actual instance doesn't
> matter. The stuff which would be a "valuetype" in IDL.
> 
> > Why would you want a different connection re-use strategy on a per
> > request basis in the first place?
> 
> Good point. The only reason would be to prevent re-use of the connection
> in specific situations. If the situation is known in advance, it is
> better to send a "Connection: close" header with the request. If it is
> determined dynamically, some yet to be defined "abort" method can be
> used. No need at all for overriding the re-use strategy.
> 
> >> Should we have a NoConnectionReuseStrategy implementation
> >> of the interface in HttpCore?
> 
> This question remains open.
> 

Sorry. Missed this one. Yes, I think we should

Oleg

> thanks,
>   Roland
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org


Re: [HttpClient] where to put connection re-use strategy

Posted by Roland Weber <ht...@dubioso.net>.
Hi Oleg,

>> 2. attribute in the HttpClient
> 
> I tend to prefer 2. I am strongly not in favor of storing interfaces in
> HttpParams. CredentialsProvier was my biggest design blunder in the
> HttpClient 3.x days.

I was beginning to wonder where to draw the line between params and
context. That's a good distinction. Parameters are for constants only,
meaning instances of final classes such as String, Integer, HttpVersion.
Except that HttpVersion is not final. So rather non-functional classes,
which only _represent_ a value and where the actual instance doesn't
matter. The stuff which would be a "valuetype" in IDL.

> Why would you want a different connection re-use strategy on a per
> request basis in the first place?

Good point. The only reason would be to prevent re-use of the connection
in specific situations. If the situation is known in advance, it is
better to send a "Connection: close" header with the request. If it is
determined dynamically, some yet to be defined "abort" method can be
used. No need at all for overriding the re-use strategy.

>> Should we have a NoConnectionReuseStrategy implementation
>> of the interface in HttpCore?

This question remains open.

thanks,
  Roland


---------------------------------------------------------------------
To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org


Re: [HttpClient] where to put connection re-use strategy

Posted by Oleg Kalnichevski <ol...@apache.org>.
On Sun, 2007-01-28 at 10:18 +0100, Roland Weber wrote:
> Hi folks,
> 
> where do you feel is the best place for keeping the
> ConnectionReuseStrategy?
> 
> 1. attribute in the connection manager
> 2. attribute in the HttpClient
> 3. stored in HttpContext, allows per-request override
>    a) default as attribute in connection manager
>    b) default as attribute in HttpClient
>    c) default hard-coded (never reuse)
> 4. stored in HttpParams, allows per-request override
> 

I tend to prefer 2. I am strongly not in favor of storing interfaces in
HttpParams. CredentialsProvier was my biggest design blunder in the
HttpClient 3.x days.

Why would you want a different connection re-use strategy on a per
request basis in the first place?

Oleg


> Should we have a NoConnectionReuseStrategy implementation
> of the interface in HttpCore?
> 
> cheers,
>   Roland
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: httpcomponents-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: httpcomponents-dev-help@jakarta.apache.org