private Function<String, Metric.Context> cachedContexts(String chainDimension) {
        Map<String, Metric.Context> contextCache = new ConcurrentHashMap<>();
        return documentType -> contextCache.computeIfAbsent(documentType, type -> {
            Map<String, String> dimensions = new HashMap<>(2);
            dimensions.put("chain", chainDimension);
            dimensions.put("documenttype", type);
            return metric.createContext(dimensions);
        });
    }
Processes a given Processing through the CallStack of this executor. Note that if a DocumentProcessor
returns a LaterProgress for this processing, it will be re-processed (after waiting the specified delay given
by the LaterProgress), until done or failed.

@param processing the Processing to process. The CallStack of the Processing will be set to a clone of the CallStack of this executor, iff. it is currently null.
@return a Progress; this is never a LaterProgress.
@throws RuntimeException if a document processor throws an exception during processing, or this thread is interrupted while waiting.
@see com.yahoo.docproc.Processing
@see com.yahoo.docproc.DocumentProcessor.Progress
@see com.yahoo.docproc.DocumentProcessor.LaterProgress
docproc/src/main/java/com/yahoo/docproc/impl/DocprocExecutor.java