Skip to content

Instantly share code, notes, and snippets.

@ahndmal
Created July 28, 2024 13:19
Show Gist options
  • Save ahndmal/456cf52bff3756ff3e8cf07ebf1cdc93 to your computer and use it in GitHub Desktop.
Save ahndmal/456cf52bff3756ff3e8cf07ebf1cdc93 to your computer and use it in GitHub Desktop.
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