Top "Futuretask" questions

A cancellable asynchronous computation.

CompletableFuture, supplyAsync() and thenApply()

Need to confirm something. The following code: CompletableFuture .supplyAsync(() -> {return doSomethingAndReturnA();}) .thenApply(a -> convertToB(a)); would …

multithreading java-8 concurrency completable-future futuretask
Is it a good way to use java.util.concurrent.FutureTask?

First of all, I must say that I am quite new to the API java.util.concurrent, so maybe what …

java multithreading concurrency futuretask
Utility of Future.cancel(boolean) method

I was simply exploring the java.util.concurrent package. I learnt that the class 'Future' has a method boolean cancel(…

java multithreading future futuretask
What's the difference between Future and FutureTask in Java?

Since use ExecutorService can submit a Callable task and return a Future, why need to use FutureTask to wrap Callable …

java executorservice callable futuretask
How to catch exceptions in FutureTask

After finding that FutureTask running in a Executors.newCachedThreadPool() on Java 1.6 (and from Eclipse) swallows exceptions in the Runnable.run() …

java concurrency executorservice futuretask
How to implement PriorityBlockingQueue with ThreadPoolExecutor and custom tasks

I've searched a lot but could not find a solutuion to my problem. I have my own class, BaseTask, that …

java threadpool priority-queue executor futuretask
How do I get FutureTask to return after TimeoutException?

In the code below, I'm catching a TimeoutException after 100 seconds as intended. At this point I would expect the code …

java futuretask
Getting a result in the future?

I'm looking to get a result from a method which can take a while to complete and doesn't actually return …

java asynchronous runnable callable futuretask
Difference between TimerTask and Executors.newScheduledThreadPool(1)

I need to schedule some work to be done in the future. I can do it in 2 ways: Create a …

java multithreading timer futuretask
how to convert java Future<V> to guava ListenableFuture<V>

I need to find a way to convert from Future to ListenableFuture. Currently i'm using a service which returns Future …

java concurrency guava futuretask