This is great!
If I might make a suggestion. Can we have a hierarchy like:
client/core
client/examples
So that people can submit patches to add their examples which
illustrate their use cases. Then people could also submit changes to
the API, which might be needed to support their use case, for us to
all discuss.
Regards,
Alan
On Mar 18, 2008, at 1:56 PM, Mike Heath wrote:
The proposed new AsyncWeb client API is available here for your
viewing
pleasure:
http://svn.apache.org/repos/asf/mina/sandbox/mheath/asyncweb/client/
I've taken into account a lot of the feedback I've received so far.
Some of the big changes include:
- I've separated the HttpClientFactory and the HttpConnector. The
HttpConnector provides HttpConnection objects which can be thought
of as
a step above a MINA IoSession. The HttpClientFactory produces
HttpClient instances that provide a friendlier interface to issuing
asynchronous HTTP requests. The configuration options have been
separated as well
- The HttpFuture object has get/setPayload methods that allow the user
to arbitrarily associate an object with the future (this is an idea
borrow from the JSR 203 IoFuture).
- I added an HttpRequestFuture interface that extends HttpFuture and
returns the HttpRequest object used to initiate the request
- I added support for sending HttpRequest objects directly
- I added PartialResponseListener for dealing with large responses.
This has the same name as an interface proposed by Julien for the
server
API so we may need to change the name and/or discover overlap with the
server side of the framework
- I added some configuration options for HTTP proxy settings
Some of the things that we need to work on still
- We still need to add something analogous to the IoServiceListener in
MINA or the Event mechanism in AHC
- We need some way for configuring different encoding mechanisms (i.e.
gzip encoding)
- Caching - good caching and support for ETag would be a big plus
I'm thinking that a HttpClientFactory would use a HttpConnector under
the hood. This would allow us to implement HttpClientFactory and
HttpClient once and be able to plug in any transport that implements
HttpConnector. We can also implement connection pooling by creating a
HttpConnector implementation that proxies another HttpConnector that
does the actual network communication.
It's still a work in progress so please tell me what you don't like
and
what could be improved.
-Mike