Created
July 28, 2024 13:19
-
-
Save ahndmal/456cf52bff3756ff3e8cf07ebf1cdc93 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Gatherer<URI, ?, String> mapToCOntents = gatherers.mapCOncurrent(16, uri -> { | |
try { | |
return fetch(uri); | |
} catch(IOEsception e) { | |
throw new UncheckedIOEsception(e); | |
}; | |
String result = Stream.of(uris) | |
.gather(mapToContents) | |
.collect(Collectors.joining(", ", "{ ", " }")); | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment