hc-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Xu, Lilu" <cooki...@gmail.com>
Subject Re: Fluent HttpClient
Date Fri, 29 Jul 2011 14:44:46 GMT
Hi Oleg,

now it is much clear that:
1) FluentRequest implements HttpRequest
and encapsulates CredentialsProvider, HttpContext, and HttpParams;
2) FluentExecutor encapsulates SchemeRegistry, SchemeSocketFactory,
and ThreadSafeClientConnManager;
3) FluentResponse implements HttpResponse.

Those methods related to the HttpParam/HttpContext/CredentialsProvider have
been moved back to FluentRequest. And I think the FluentExecutor should be
thread-safe now.
According to the module table [1], there remains one part which is HTTP
test. I am a little confused here about how to implement this part.
By referring to the classes in org.apache.stanbol.commons.testing.http.*
 like RequestExecutor, I found JUnit 4 is used. Do I need to re-implement
those methods like assertStatus/assertContentRegexp for FluentResponse (or
maybe FluentExecutor)?


[1]
https://spreadsheets.google.com/spreadsheet/ccc?key=0AmpiN3H1I3fndFBaOHpoSzI4MHlMS3RaSVg3ZEFrUkE&authkey=CJTnkIoG&hl=en_US
[2]
http://svn.apache.org/repos/asf/incubator/stanbol/trunk/commons/testing/http/src/main/java/org/apache/stanbol/commons/testing/http/RequestExecutor.java

On Mon, Jul 25, 2011 at 7:17 PM, Oleg Kalnichevski <olegk@apache.org> wrote:

>
> I would keep it simple and let the caller manager the threads manually.
> That would also relieve FluentExecutor form having to worry about
> response content.
>
> If one could execute requests concurrently like in this sample app [1]
> just using fluent API, that would be sufficient for me. What is
> important, though, that FluentExecutor is made thread-safe. I suspect
> currently it is not. You need to consider that HttpParams and
> HttpContext instances may be accessed concurrently by multiple threads.
>
> I guess HttpParams, HttpContext and possibly CredentialsProvider should
> be managed by FluentRequest and passed to FluentExecutor in some way.
>
> Oleg
>
> [1]
>
> http://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk/httpclient/src/examples/org/apache/http/examples/client/ClientMultiThreadedExecution.java
>
>
>


-- 
Best regards,
Lilu

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message