Skip to content

Commit

Permalink
feat(imp):[#214] improve readability
Browse files Browse the repository at this point in the history
  • Loading branch information
dsmf committed Jan 18, 2024
1 parent 641dd67 commit 0d2942e
Showing 1 changed file with 12 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,16 +104,21 @@ private List<AssetAdministrationShellDescriptor> fetchShellDescriptors(final Set
final var connectorEndpoints = connectorEndpointsService.fetchConnectorEndpoints(bpn);
calledEndpoints.addAll(connectorEndpoints);

final var service = endpointDataForConnectorsService;
return fetchShellDescriptorsForConnectorEndpoints(bpn, keys, connectorEndpoints);
}

private List<AssetAdministrationShellDescriptor> fetchShellDescriptorsForConnectorEndpoints(final String bpn,
final List<DigitalTwinRegistryKey> keys, final List<String> connectorEndpoints) {

try {

final var futures = //
service.findEndpointDataForConnectors(connectorEndpoints)
.stream()
.map(edrFuture -> edrFuture.thenCompose(
edr -> supplyAsync(() -> fetchShellDescriptorsForKey(keys, edr))))
.toList();
final var futures = endpointDataForConnectorsService.findEndpointDataForConnectors(connectorEndpoints)
.stream()
.map(edrFuture -> edrFuture.thenCompose(
edr -> supplyAsync(
() -> fetchShellDescriptorsForKey(keys,
edr))))
.toList();

return resultFinder.getFastestResult(futures).get();

Expand Down

0 comments on commit 0d2942e

Please sign in to comment.