ImmutableList.<ExecutionFailureInfo>of()));
// fire delete to task and ignore response
if (taskInfo.getSelf() != null) {
final long start = System.nanoTime();
final Request request = prepareDelete()
.setUri(uriBuilderFrom(taskInfo.getSelf()).addParameter("summarize").build())
.build();
Futures.addCallback(httpClient.executeAsync(request, createStatusResponseHandler()), new FutureCallback<StatusResponse>()
{
@Override
public void onSuccess(StatusResponse result)
{
// assume any response is good enough
}
@Override
public void onFailure(Throwable t)
{
if (t instanceof RejectedExecutionException) {
// client has been shutdown
return;
}
// reschedule
if (Duration.nanosSince(start).compareTo(new Duration(2, TimeUnit.MINUTES)) < 0) {
Futures.addCallback(httpClient.executeAsync(request, createStatusResponseHandler()), this, executor);
}
else {
log.error(t, "Unable to cancel task at %s", request.getUri());
}
}
}, executor);
}
}