我有以下代码:
for (int i = 0; i < nComp; i++) {
Callable<Long> worker = new WSCaller(compConns[i]);
col.add(worker);
}
List<Future<Long>> results=null;
results = executor.invokeAll(col, timeout, TimeUnit.SECONDS);
for (Future<Long> future : results) {
if ( !future.isDone() ) {
// here I need to know which future timed-out ...
}
}
正如代码中所指出的......我怎么知道哪个 Future 超时?
谢谢