The list of methods to do Thread Future are organized into topic(s).
FutureCallback
callback(final CountDownLatch latch)
callback
return new FutureCallback<V>() {
@Override
public void onSuccess(final V result) {
latch.countDown();
@Override
public void onFailure(final Throwable t) {
latch.countDown();
...
void
checkTimeThresholds(long expectedMin, long expectedMax, long expectedOverhead, long start, Map> responses) check Time Thresholds
long time = getMaxIn(responses) - start;
assert time >= expectedMax && time < expectedMax + expectedOverhead : String
.format("expectedMax %d, max %d", expectedMax, time);
time = getMinIn(responses) - start;
assert time >= expectedMin && time < expectedMin + expectedOverhead : String
.format("expectedMin %d, min %d", expectedMin, time);
time = getMaxIn(responses) - start;
assert time >= expectedMax && time < expectedMax + expectedOverhead : String
...
CompletableFuture
convertFuture(Future future)
convert Future
CompletableFuture<V> brighterFuture = supplyAsync(() -> {
try {
return future.get();
} catch (Exception e1) {
throw new RuntimeException(e1);
});
return brighterFuture;
...
CompletableFuture
createFuture()
create Future
return new CompletableFuture<T>();