Java Thread Future now(Collection> s)

Here you can find the source of now(Collection> s)

Description

now

License

Open Source License

Declaration

public static Collection<Integer> now(Collection<Future<Integer>> s)
            throws InterruptedException, ExecutionException 

Method Source Code

//package com.java2s;
/*//from   w w w. j  av  a  2s  . c o  m
 * Copyright (C) ${year} Omry Yadan <${email}>
 * All rights reserved.
 *
 * See https://github.com/omry/banana/blob/master/BSD-LICENSE for licensing information
 */

import java.util.*;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.Future;

public class Main {
    public static Collection<Integer> now(Collection<Future<Integer>> s)
            throws InterruptedException, ExecutionException {
        Set<Integer> res = new HashSet<Integer>();
        for (Future<Integer> r : s)
            res.add(r.get());
        return res;
    }
}

Related

  1. getSysExeNameList()
  2. getUninterruptibly(Future future)
  3. invokeTask(String threadName, Callable callable)
  4. isSuccessful(CompletableFuture f)
  5. nanoTime()
  6. rollback(Object tx)
  7. runIfNotDoneAndGet(RunnableFuture future)
  8. runInNewThread(String threadName, Runnable target)
  9. sequence(List> futures)