[concurrency-interest] Another CompletableFuture Question

Haim Yadid haim at performize-it.com
Tue Apr 29 16:02:48 EDT 2014


Hi,
Is the a good way to convert a future to a CompletableFuture ?
The only way I have found is to wrap the Future which causes an overhead of
another busy thread.

    public static <V> CompletableFuture<V> convertFuture(Future<V> future) {
        CompletableFuture<V> brighterFuture = supplyAsync(() -> {
            try {
                return future.get();
            } catch (Exception e1) {
                throw new RuntimeException(e1);
            }
        });
        return brighterFuture;
    }

>
>
>

-- 
Haim Yadid | Performization Expert
Performize-IT | t +972-54-7777132
www.performize-it.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://cs.oswego.edu/pipermail/concurrency-interest/attachments/20140429/cfe6b738/attachment.html>


More information about the Concurrency-interest mailing list