hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Pete Keyes <PKe...@starbucks.com>
Subject Aborting background request: apache-hc 4.5.2
Date Fri, 25 Mar 2016 18:42:14 GMT
Are there any significant downsides to using HttpRequest.abort() to signal that a request should
give up as soon as possible?  Knowing that this is a blocking I/O not the apache async client.
 Or, is simply better to let it go on naturally and discard the request’s response whenever
it completes?

The basic pattern is
HttpRequestBase request = ...
Future f = executor.submit(r)
try {
    f.get(ms, TimeUnit.MILLISECONDS);
}
catch(TimeoutException e) {
    request.abort();  // <<< ?good or bad?
    throw e;
}

—
Pete Keyes
Starbucks Coffee Co.


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