use of com.yahoo.processing.execution.AsyncExecution in project vespa by vespa-engine.
the class Federator method process.
@SuppressWarnings("unchecked")
@Override
public Response process(Request request, Execution execution) {
List<FutureResponse> futureResponses = new ArrayList<>(chains.size());
for (Chain<? extends Processor> chain : chains) {
futureResponses.add(new AsyncExecution(chain, execution).process(request));
}
Response response = execution.process(request);
AsyncExecution.waitForAll(futureResponses, 1000);
for (FutureResponse futureResponse : futureResponses) {
Response federatedResponse = futureResponse.get();
response.data().add(federatedResponse.data());
response.mergeWith(federatedResponse);
}
return response;
}
Aggregations