public static Future execute(ParseContext context, Runnable runnable) {

        Future future = null;
        ExecutorService executorService = context.get(ExecutorService.class);
        if (executorService == null) {
            FutureTask task = new FutureTask<>(runnable, null);
            Thread thread = new Thread(task, "Tika Thread");
            thread.start();
            future = task;
        } else {
            future = executorService.submit(runnable);
        }

        return future;
    }
Execute a runnable using an ExecutorService from the ParseContext if possible.
Otherwise fallback to individual threads.

@param context
@param runnable
@return
tika-core/src/main/java/org/apache/tika/utils/ConcurrentUtils.java