use of com.tvd12.ezyfox.concurrent.EzyFutureTask in project ezyhttp by youngmonkeys.
the class ResourceDownloadManager method drain.
public void drain(InputStream from, OutputStream to) throws Exception {
Entry entry = new Entry(from, to);
EzyFuture future = new EzyFutureTask();
drain(entry, future);
future.get(DEFAULT_TIMEOUT);
}
use of com.tvd12.ezyfox.concurrent.EzyFutureTask in project ezyhttp by youngmonkeys.
the class HttpClientProxy method request.
public ResponseEntity request(Request request, int timeout) throws Exception {
EzyFuture future = new EzyFutureTask();
futures.addFuture(request, future);
try {
addRequest(request);
} catch (Exception e) {
futures.removeFuture(request);
throw e;
}
return future.get(timeout);
}
Aggregations