koji
積分 1
List<URLData> retrieveURLs(URL... urls) throws Exception {
try (var executor = Executors.newVirtualThreadExecutor()) {
var tasks = Arrays.stream(urls)
.map(url -> (Callable<URLData>)() -> getURL(url))
.toList();
return executor.submit(tasks)
.filter(Future::isCompletedNormally)
.map(Future::join)
.toList();
}
}
乍看想說isCompletedNormally會true嗎,結果這是新API然後 submit(java.util.Collection)1
Returns:
stream of completed Futures
這 code review 沒看過的會搞不懂吧
christinatilly
積分 1
Travis CI is a continuous integration tool that can be integrated with your project to automatically test and deploy on each change you made