final List<String> endpoints = getEndpoints(_endpoint, contextSeq, dynEnv);
final int numEndpoints = endpoints.size();
if(numEndpoints == 0) {
return ValueSequence.EMPTY_SEQUENCE;
}
final Sequence result;
if(numEndpoints == 1) {
result = invokeRequest(endpoints.get(0), request);
} else if(_parallel) {
result = invokeRequestsInParallel(endpoints, _hostVar, request, dynEnv);
} else {
Sequence lastSeq = invokeRequest(endpoints.get(0), request);
for(int i = 1; i < numEndpoints; i++) {
Sequence secSeq = invokeRequest(endpoints.get(i), request);
lastSeq = new ChainedSequence(lastSeq, secSeq, dynEnv);
}
result = lastSeq;
}
return result;