-----Original Message-----
From: Oleg Kalnichevski [mailto:[email protected]] 
Sent: Friday, January 10, 2014 9:06 AM
To: HttpClient User Discussion
Subject: Re: Most efficient way of putting file from CD Drive

On Fri, 2014-01-10 at 13:51 +0000, Boxer, Aaron wrote:
> > I have a CD with about 1000 files on it. I need to upload them (via WebDAV 
> > client).
> >
> > Currently, I go one by one through the files, and put to the server using 
> > InputStreamEntity .
> >
> > IS there a better way?  Can I use an NIO buffer, to avoid copy into user 
> > space ?
> >
> 
> 
> This is one (rather few) cases where HttpAsyncClient may do a better 
> job than blocking HttpClient due to its support for zero copy uploads 
> / downloads
> 
> http://hc.apache.org/httpcomponents-asyncclient-4.0.x/
> http://hc.apache.org/httpcomponents-asyncclient-4.0.x/httpasyncclient/
> examples/org/apache/http/examples/nio/client/ZeroCopyHttpExchange.java
> 
> 
> 
> Thanks, Oleg! That is exactly what I want.
> 
> If I make 100 asynch posts, are they executed in sequence? 

HttpAsyncClient executes requests concurrently given the maximum limit of 
connections allowed by the connection manager (per host and total).
If want all 100 requests to be executed in parallel you need to increase
per host limit to 100 and total limit to n >= 100.   

Great. Actually, I only want to execute batches of 3-5 posts at a time

>  Also, what if I want to cancel
> the posts?
> 

Well, if you want to cancel the posts then go ahead and cancel them.

Thanks.

Aaron


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]


This e-mail may contain confidential and/or privileged information for the sole 
use of the intended recipient. 
Any review or distribution by anyone other than the person for whom it was 
originally intended is strictly prohibited. 
If you have received this e-mail in error, please contact the sender and delete 
all copies. 
Opinions, conclusions or other information contained in this e-mail may not be 
that of the organization.

Reply via email to