ConcurrentRenderHelper crHelper = ConcurrentRenderHelper.getInstance(context, doc);
String delcaration = null;
if (crHelper.hasUnCompletedTask()) {
delcaration = null;
try {
FutureRendererHolder holder = crHelper.take();
delcaration = holder.getRenderDeclaration();
String ref = holder.getSnippetRefId();
String reSelector = SelectorUtil.attr(ExtNodeConstants.SNIPPET_NODE_TAG_SELECTOR, ExtNodeConstants.ATTR_SNIPPET_REF,
ref);
Element element = doc.select(reSelector).get(0);// must have
Element target;
if (element.attr(ExtNodeConstants.SNIPPET_NODE_ATTR_TYPE).equals(ExtNodeConstants.SNIPPET_NODE_ATTR_TYPE_FAKE)) {
target = element.children().first();
} else {
target = element;
}
applySnippetResultToElement(doc, ref, element, target, holder.getRenderer());
applySnippets(doc);
} catch (InterruptedException | ExecutionException e) {
throw new SnippetInvokeException("Concurrent snippet invocation failed" +
(delcaration == null ? "" : " on [" + delcaration + "]"), e);
}